jsonschema-spec
JSONSchema Spec with object-oriented paths
What it is and what it does
jsonschema-spec wraps JSONSchema documents in an object-oriented path interface, letting you navigate nested schema structures using forward-slash syntax while automatically resolving $ref pointers to local or remote definitions. Instead of manually parsing dictionaries and tracking reference paths, you construct a SchemaPath from a schema dict and then traverse it like a filesystem—checking key membership, concatenating paths, and opening dereferenced content on demand. The package handles both internal references (like #/$defs/Info) and external URLs, delegating actual HTTP fetches to requests and reference resolution to the referencing library.
This is most useful when you need to inspect or validate schema structure programmatically—for example, walking a schema to extract all property definitions, following $ref chains to understand the full shape of a nested object, or building tools that reason about schema metadata. It sits between raw dict manipulation and full schema validation, offering a cleaner API for schema introspection without enforcing validation rules.
Use it for:
- Extract all properties from a JSONSchema by traversing the schema tree and following $ref pointers automatically
- Build API documentation tools that need to walk OpenAPI or JSONSchema specs and resolve references
- Validate that a schema structure is well-formed by checking key existence and dereferencing paths
- Generate code or type definitions from a schema by navigating its structure and collecting metadata
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an object-oriented interface to traverse and dereference JSONSchema documents, treating them as navigable paths with automatic resolution of $ref pointers.
Yes, if you need to programmatically inspect or traverse JSONSchema documents with automatic reference resolution. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. Not necessary if you only validate data against schemas or parse schemas as raw dicts.
Install
jsonschema-spec on PyPI
pip
pip install jsonschema-specuv
uv add jsonschema-specpoetry
poetry add jsonschema-specInstalling jsonschema-spec
Before you install
Low friction installation with four straightforward runtime dependencies (pathable, PyYAML, requests, referencing). Actively maintained with recent commits; last release was over a year ago but the repository remains active.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must retain copyright and license notices in distributions.
Quickstart
from jsonschema_spec import SchemaPath
schema = {
"properties": {"info": {"$ref": "#/$defs/Info"}},
"$defs": {"Info": {"properties": {"title": {"type": "string"}}}}
}
path = SchemaPath.from_dict(schema)
info_path = path / "properties" / "info"
with info_path.open() as contents:
print(contents)
Verify before relying
- Whether the package handles circular $ref chains or other edge cases in schema dereferencing
- Performance characteristics when working with very large or deeply nested schemas
- Whether remote schema fetching via requests is cached or requires manual optimization
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8.0,<4.0.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — pathable, PyYAML, requests, referencing |
| Maintenance | actively maintained — 1,094 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 924,766/month — #4,711 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonschema_spec-0.2.4-py3-none-any.whl
Keywords: jsonschema, swagger, spec
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
jsonschema-pathProvides object-oriented path-based access to…
permissive · top 1,000 on PyPI
jsonrefjsonref dereferences JSON Reference objects…
permissive · top 1,000 on PyPI
json-ref-dictProvides a dict-like interface to JSONSchema…
permissive · top 15,000 on PyPI
referencingResolves JSON references according to JSON…
permissive · top 100 on PyPI
sphinx-jsonschemaA Sphinx extension that renders JSON Schema…
copyleft · top 15,000 on PyPI
openapi-schema-validatorValidates data and schemas against OpenAPI…
permissive · top 1,000 on PyPI
marshmallow-jsonschemaConverts marshmallow schemas into JSON Schema…
permissive · top 5,000 on PyPI
prancePrance parses and validates Swagger/OpenAPI 2.0…
unclear · top 5,000 on PyPI
openapi-spec-validatorValidates OpenAPI specifications (versions 2.0,…
permissive · top 1,000 on PyPI
jsonschemajsonschema validates Python data structures…
permissive · top 100 on PyPI