skillfed

marshmallow-jsonschema

JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow

marshmallow-jsonschema v0.16.0 939.9K downloads/30d#4,684 on PyPI214
Permissive license MIT License Active released

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-jsonschema

uv

uv add marshmallow-jsonschema

poetry

poetry add marshmallow-jsonschema

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

marshmallow to json schemaschema validation jsonjson schema generationmarshmallow schema exportform rendering from schemaapi schema documentationcross-platform schema validation
schema-validationjson-schemaserialization

More Software Development packages

typing-extensions

Provides backported and experimental type hints…

permissive · top 100 on PyPI

numpy

NumPy provides an N-dimensional array object…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

annotated-doc

Provides a way to document function parameters,…

permissive · top 100 on PyPI

typer

Typer builds command-line applications from…

permissive · top 1,000 on PyPI

distlib

Distlib provides low-level packaging utilities…

permissive · top 1,000 on PyPI

drf-jsonschema-serializer

Converts Django REST Framework serializers to…

permissive · top 15,000 on PyPI

jsonschema-typed-v2

Generates Python TypedDict type annotations…

permissive · top 15,000 on PyPI

marshmallow-enum

Provides an Enum field type for Marshmallow…

permissive · top 5,000 on PyPI

sphinx-jsonschema

A Sphinx extension that renders JSON Schema…

copyleft · top 15,000 on PyPI

genson

GenSON generates JSON Schema documents from…

permissive · top 5,000 on PyPI

jsonschema2md

Converts JSON Schema files to human-readable…

permissive · top 5,000 on PyPI

json-schema-for-humans

Generates static HTML or Markdown documentation…

permissive · top 5,000 on PyPI

jsonschema-gentypes

Generates Python TypedDict types from JSON…

permissive · top 15,000 on PyPI

apispec-oneofschema

Extends apispec to generate OpenAPI 3.0+…

permissive · top 15,000 on PyPI

jsonschema-pydantic

Converts JSON Schema definitions into Pydantic…

unclear · top 15,000 on PyPI