skillfed

drf-jsonschema-serializer

JSON Schema support for Django REST Framework

drf-jsonschema-serializer v3.0.0 168.5K downloads/30d#10,446 on PyPI46
Permissive license Copyright (c) 2017, ISProjects Copyright (c) 2023, Maykin Media All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) AGING released

What it is and what it does

drf-jsonschema-serializer bridges Django REST Framework serializers and JSON Schema, allowing you to use the same validation rules on both client and server. It provides a converter that turns a DRF serializer into a JSON Schema representation, and field types that validate incoming JSON data against a schema or serializer definition. This is useful when you want to generate client-side forms dynamically from your server-side serializer definitions, or when you need to accept and validate arbitrary JSON payloads that conform to a known schema.

The package depends on django, djangorestframework, and jsonschema. It is stable (Production/Stable status) and supports Python 3.10, 3.11, and 3.12. Maintenance has slowed—the last release was 779 days ago—but the repository remains open and not archived, suggesting it is suitable for projects that do not require frequent updates.

Use it for:

  • Generate web forms dynamically from DRF serializers using client-side libraries.
  • Validate JSON payloads in REST endpoints against a predefined JSON Schema without custom logic.
  • Accept flexible JSON structures in a single field while maintaining schema-based validation.
  • Share validation rules between a Django backend and a frontend form library to keep them in sync.
  • Build APIs that accept polymorphic or nested JSON data with schema-driven validation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts Django REST Framework serializers to JSON Schema and provides fields to validate JSON data against schemas or serializers, enabling shared validation between client-side and server-side.

Yes, if you are building a Django REST API that needs to share schema-based validation with a client-side form library or accept flexible JSON payloads. The low install friction and permissive license make it a safe choice. However, the aging maintenance status (779 days since last release) means it is best suited to stable projects that do not require frequent updates or rapid bug fixes. Check that your versions of django and djangorestframework are compatible before adopting.

Install

drf-jsonschema-serializer on PyPI

pip

pip install drf-jsonschema-serializer

uv

uv add drf-jsonschema-serializer

poetry

poetry add drf-jsonschema-serializer

Installing drf-jsonschema-serializer

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 779 days ago, though the repository remains active with a recent commit on 2025-05-14. Suitable for stable, established projects but not for rapid iteration.

License in practice

BSD license (permissive). You may use, modify, and distribute this package freely in commercial and private projects, provided you retain the copyright notice and disclaimer.

Quickstart

pip install drf-jsonschema-serializer

from drf_jsonschema_serializer.fields import JSONSchemaField

class MySerializer:
    data = JSONSchemaField(schema={"type": "object"})

Requires Python 3.10 or later; django, djangorestframework, and jsonschema must be installed.

Verify before relying

  • Specific versions of django and djangorestframework supported beyond Django 4.2.
  • Performance characteristics with large or deeply nested JSON schemas.
  • Whether react-jsonschema-form integration is documented or requires custom glue code.

Package facts

License Copyright (c) 2017, ISProjects Copyright (c) 2023, Maykin Media All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — django, djangorestframework, jsonschema
Maintenance aging — 779 days since the last release
Last repo commit
First released
Downloads 168,495/month — #10,446 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: drf_jsonschema_serializer-3.0.0-py3-none-any.whl

Keywords: django, rest, polymorphic

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Software Development :: Libraries :: Python Modules

Tags

django rest framework json schemadrf serializer to json schemajson schema validation djangojsonschema field django restclient-side form generation django
json-schemaform-generationvalidation

More Python Modules packages