A utility to extract a sub-schema from a JSON Schema by traversing a path (using / or . separators). Version 2.0.1 is current. Supports properties, additionalProperties, patternProperties, and items. Returns null if no schema exists at path. Simple, no external dependencies. Lightweight alternative to full JSON Schema processors for path-based lookups.
npm install json-schema-from-pathNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using require to import the function, defining a schema, and retrieving the sub-schema at path 'user/name'.
Ensure properties are ordered as expected or use array paths consistently.
Use if (subSchema === null) to detect missing paths.
Use only one separator consistently, e.g., always '/' or always '.'.
Use const getSchemaFromPath = require('json-schema-from-path'); or import getSchemaFromPath from 'json-schema-from-path';Check if getSchemaFromPath returns null before accessing properties.
No dependency data recorded yet.