json-schema-it is a lightweight, type-safe JSON Schema generator for JavaScript/TypeScript (v1.2.24, stable). It converts JavaScript values—primitives, objects, and arrays—into JSON Schema objects without custom options or configuration. It ships TypeScript types and supports both ESM and CJS. Key differentiators: zero dependencies, no configuration, and strictly clamps to standard JSON typeof types (e.g., null is not allowed). It throws on undefined, Symbol, and BigInt. Released via Release Please on GitHub with community maintenance under the Braze organization. Suitable for validation, documentation generation, and API schema inference.
npm install json-schema-itNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates generating a JSON Schema from a JavaScript object with various types.
Pass only valid JSON values (string, number, boolean, object, array). Use e.g. generateSchema({key: null}) for objects containing null.Exclude undefined from input or use a default value.
N/A
Ensure consistency or use a different schema library for mixed arrays.
Do not pass undefined; use null or exclude the property.
Convert Symbol to string before passing.
Convert BigInt to number or string.
No dependency data recorded yet.