Extracts a flattened JSON schema object from a compiled AJV validator instance by resolving all $ref references. Version 1.0.1 is the current stable release. This is a single-purpose utility with no updates since initial release. It differs from alternatives by working directly with AJV instances rather than schemas, making it useful for debugging and serialization of validated schemas.
npm install flat-ajv-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to flatten an AJV validator instance into a resolved schema object.
Ensure you pass the result of ajv.getSchema(...) or similar AJV compiled validator.
Use the output to understand reference structure, not as a standalone validated schema.
Upgrade your schema to draft-07 or later.
Add 'declare module 'flat-ajv-schema';' in a .d.ts file.
Ensure you pass the result of ajv.getSchema(schemaId) or new Ajv().compile(schema).
Install ajv: npm install ajv
Make sure the AJV instance was created with the schemas option or addSchema was used.