Transforms a JSON Schema into a tcomb type for runtime type checking. Current stable version is 0.3.2, compatible with tcomb ^3.0.0. Released infrequently, last update in 2016. Key differentiator: bridge between JSON Schema and tcomb's type system, enabling runtime validation based on JSON schemas. Supports custom formats, custom types, and schema features like pattern, enum, and required fields.
npm install tcomb-json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a JSON schema to a tcomb type and performs validation, showing success and error cases.
Update tcomb to ^3.0.0 if using tcomb-json-schema ^0.3.0.
Use const transform = require('tcomb-json-schema'); then transform.registerFormat(...).Consider alternatives like ajv or typebox, or validate manually.
Use array enum for standard behavior; object enum maps keys to values.
Install tcomb: npm install tcomb
Use const transform = require('tcomb-json-schema') and then transform.registerFormat(...)Ensure all required properties are present: add name: 'John'