Converts JSON Schema to Joi schema for object validation. Stable v9.0.1 (latest), maintained with regular releases. Key differentiator: provides bidirectional conversion between JSON Schema (including OpenAPI) and Joi, supporting sub-schemas, custom types, and refinement functions. Minimal dependencies (only peer dep on joi 17+). Does not support all JSON Schema keywords (e.g., patternProperties).
npm install enjoiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a simple JSON Schema to a Joi schema and validates an object.
Use additionalProperties or custom validation via refineSchema for unsupported keywords.
Upgrade Node to >=8 and ensure joi >=17.1.0 is installed.
Use string referencing e.g., 'sub#/d' for sub-schemas; root is '#'.
Use Enjoi.schema() directly; do not call new Enjoi().
Use `Enjoi.schema(...)` instead of `new Enjoi(...)`.
Run `npm install joi` to install joi >=17.1.0.
Use `additionalProperties` with a schema, or use `refineSchema` to add custom validation.