A simple, flexible, and intuitive JSON Schema validator for Node.js. Version 4.0.0 supports nested schemas, type checking, required fields, defaults, enums, pattern matching, and custom validators like isEmail and trim. It mutates the input object by applying defaults and trims. Compared to ajv, it is less compliant with JSON Schema spec but offers a simpler API and easier custom extensions. Release cadence is low; the package appears in maintenance mode with infrequent updates.
npm install another-json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a schema, validate data, and see the result object with applied defaults.
Pass a clone if you need to preserve original: schema.validate(JSON.parse(JSON.stringify(data)))
Always define sub-schemas with AJS('name', {...}) to get proper validation.Consider migrating to ajv or another actively maintained JSON Schema validator.
Run 'npm install another-json-schema' in your project directory.
Use 'const AJS = require('another-json-schema')' instead of import.Ensure you create a schema: const schema = AJS('name', { ... })No dependency data recorded yet.