fluent-json-schema is a fluent API to generate JSON Schema (draft-07) documents for Node.js and browsers. Version 6.0.0 is current, with frequent releases following Fastify ecosystem cadence. Framework agnostic, it provides runtime validation of schema keywords and constant reuse from JavaScript values. Alternative to manual schema objects or JSON Schema builders like jsonschema or ajv's schema generation. Ships TypeScript definitions with 100% coverage.
npm install fluent-json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a simple JSON Schema object with fluent methods and outputs the schema.
Use import S from 'fluent-json-schema' or import { S } ... depending on module system.Use S.string().format('email') instead of S.string().format(S.FORMATS.EMAIL)Ensure raw JSON is valid JSON Schema and does not conflict with fluent keywords.
Use .required() as a chained call on the property, e.g., S.string().required()
Replace .id(...) with .$id(...)
Use import * as S from 'fluent-json-schema' or const S = require('fluent-json-schema')Ensure require call is correct: const S = require('fluent-json-schema');Either use a JSON Schema validator that supports custom keywords or avoid non-standard keywords. Alternatively, wrap with S.raw().
Ensure .prop() is only chained after S.object()
No dependency data recorded yet.