marshmallow-jsonschema
JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
What it is and what it does
marshmallow-jsonschema bridges schema validation and cross-platform form rendering by translating marshmallow schemas into JSON Schema Draft v7 documents. This is useful when you need to validate data or render forms in environments where you cannot import marshmallow—such as web browsers, mobile apps, or API gateways—while keeping your schema definition in one place.
The package handles simple fields, nested schemas, arrays, validators (Range, Length, OneOf, Regexp, etc.), and enum fields. It supports recursive schema references and allows customization of the definitions path and field-level metadata. Validators automatically translate to JSON Schema constraints (e.g., validate.Range becomes minimum/maximum), and schema-level metadata like title and description are preserved in the output.
Use it for:
- Render a marshmallow schema as an interactive form in a web browser or native desktop using json-editor or react-jsonschema-form.
- Validate request and response bodies in an API gateway or contract-test layer that consumes JSON Schema directly.
- Publish your data schema as documentation alongside an OpenAPI specification.
- Translate validation rules from marshmallow into a format consumable by mobile or desktop applications.
- Generate JSON Schema for client-side form validation without duplicating schema logic.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts marshmallow schemas into JSON Schema Draft v7 documents, enabling schema validation and form rendering outside Python environments.
Yes. The package is actively maintained, has no known vulnerabilities, imposes minimal install friction, and solves a genuine problem: keeping schema definitions in one place while making them available to non-marshmallow consumers. It is well-suited for teams building APIs or multi-platform applications that need consistent validation across environments.
Install
marshmallow-jsonschema on PyPI
pip
pip install marshmallow-jsonschemauv
uv add marshmallow-jsonschemapoetry
poetry add marshmallow-jsonschemaInstalling marshmallow-jsonschema
Before you install
Low friction: single runtime dependency (marshmallow), pure Python wheel, actively maintained with release within the past 110 days. Requires Python 3.9+ and marshmallow 3.13 or later.
License in practice
MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from marshmallow import Schema, fields
from marshmallow_jsonschema import JSONSchema
class UserSchema(Schema):
username = fields.String()
age = fields.Integer()
JSONSchema().dump(UserSchema())
Requires Python 3.9+ and marshmallow 3.13 or later.
Verify before relying
- Whether the package handles all marshmallow field types and custom validators beyond those documented in the excerpt.
- Performance characteristics when translating large or deeply nested schemas.
- Compatibility details with marshmallow 4 beyond the stated 'works on both marshmallow 3 and marshmallow 4'.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — marshmallow |
| Maintenance | actively maintained — 110 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 939,900/month — #4,684 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: marshmallow_jsonschema-0.16.0-py3-none-any.whl
Keywords: marshmallow-jsonschema, marshmallow, schema, serialization, jsonschema, validation
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
drf-jsonschema-serializerConverts Django REST Framework serializers to…
permissive · top 15,000 on PyPI
jsonschema-typed-v2Generates Python TypedDict type annotations…
permissive · top 15,000 on PyPI
marshmallow-enumProvides an Enum field type for Marshmallow…
permissive · top 5,000 on PyPI
sphinx-jsonschemaA Sphinx extension that renders JSON Schema…
copyleft · top 15,000 on PyPI
gensonGenSON generates JSON Schema documents from…
permissive · top 5,000 on PyPI
jsonschema2mdConverts JSON Schema files to human-readable…
permissive · top 5,000 on PyPI
json-schema-for-humansGenerates static HTML or Markdown documentation…
permissive · top 5,000 on PyPI
jsonschema-gentypesGenerates Python TypedDict types from JSON…
permissive · top 15,000 on PyPI
apispec-oneofschemaExtends apispec to generate OpenAPI 3.0+…
permissive · top 15,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI