jsonschema-pydantic-converter
Convert JSON Schema definitions to Pydantic models dynamically at runtime
What it is and what it does
jsonschema-pydantic-converter bridges JSON Schema and Pydantic by transforming JSON Schema dictionaries into Pydantic v2 models or TypeAdapters at runtime. This is useful when you work with dynamic or externally-defined schemas—for example, when validating data against a JSON Schema specification that you don't know until runtime, or when integrating systems that use JSON Schema with Pydantic-based applications.
The library handles a broad range of JSON Schema constructs: primitive types, arrays, nested objects, enums, union types (anyOf, oneOf), combined schemas (allOf), negation, constant values, and schema references ($ref, $defs). It preserves validation constraints like string length and pattern rules, numeric bounds, and array size limits. It also handles reserved Pydantic property names by renaming them internally while preserving the original JSON names through aliases.
Use it for:
- Validate incoming API payloads against a JSON Schema specification without manually writing Pydantic models.
- Build schema-driven applications where the data model is defined externally or loaded from configuration files.
- Bridge legacy JSON Schema-based systems with modern Pydantic-based codebases.
- Generate TypeAdapters for direct JSON string validation and serialization without intermediate model definitions.
- Handle dynamic or user-provided schemas in data processing pipelines where models cannot be hardcoded.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts JSON Schema definitions to Pydantic v2 models at runtime, enabling dynamic validation and serialization of data against JSON Schema specifications.
Yes, with conditions. Install if you need to work with dynamic JSON Schemas and want Pydantic validation without writing models by hand. The library is actively maintained, has no known vulnerabilities, and low install friction. However, it is in Alpha status (first release 2025-11-12), so expect potential API changes and test thoroughly before using in production.
Install
jsonschema-pydantic-converter on PyPI
pip
pip install jsonschema-pydantic-converteruv
uv add jsonschema-pydantic-converterpoetry
poetry add jsonschema-pydantic-converterInstalling jsonschema-pydantic-converter
Before you install
Low install friction with a single runtime dependency on pydantic. Active maintenance with recent commits and no known vulnerabilities. Early-stage project (Alpha status, first release 2025-11-12) but receiving regular updates.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
from jsonschema_pydantic_converter import create_type_adapter
schema = {
"type": "object",
"properties": {"name": {"type": "string"}, "age": {"type": "integer"}},
"required": ["name"]
}
adapter = create_type_adapter(schema)
user = adapter.validate_python({"name": "John", "age": 30})
Requires Python 3.10 or later and pydantic as a runtime dependency.
Verify before relying
- Performance characteristics when converting large or deeply nested schemas at runtime.
- Completeness of JSON Schema draft support (which draft versions are fully covered).
- Behavior with circular or mutually recursive schema definitions beyond stated self-reference support.
- Real-world production stability given Alpha status and limited adoption signals.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pydantic |
| Maintenance | actively maintained — 142 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 313,993/month — #7,708 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonschema_pydantic_converter-0.4.0-py3-none-any.whl
Keywords: conversion, json-schema, pydantic, schema, validation
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
dydanticDynamically generates Pydantic models from JSON…
permissive · top 5,000 on PyPI
jamboConverts JSON Schema definitions into Pydantic…
permissive · top 15,000 on PyPI
json-schema-to-pydanticAutomatically generates Pydantic v2 models from…
permissive · top 5,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI
pydantic_corepydantic-core provides the high-performance…
permissive · top 100 on PyPI
redis-omRedis OM provides declarative object mapping…
permissive · top 15,000 on PyPI
pydantic-handlebarsRenders Handlebars templates for composing LLM…
permissive · top 5,000 on PyPI
py-automapperAutomatically maps object fields from one class…
permissive · top 15,000 on PyPI
dataclasses-avroschemaGenerates Avro schemas from Python dataclasses,…
permissive · top 5,000 on PyPI
gensonGenSON generates JSON Schema documents from…
permissive · top 5,000 on PyPI