{"id":9706,"library":"drf-jsonschema-serializer","title":"DRF JSON Schema Serializer","description":"drf-jsonschema-serializer provides automatic JSON Schema generation for Django REST Framework serializers. It allows developers to define DRF serializers as usual and then easily convert them into JSON Schema Draft 2020-12, OpenAPI 3.0.x compatible schemas. The current version is 3.0.0, with releases typically tied to major Django/DRF version compatibility.","status":"active","version":"3.0.0","language":"python","source_language":"en","source_url":"https://github.com/maykinmedia/drf-jsonschema-serializer","tags":["django","drf","json-schema","serialization","api-documentation"],"install":[{"cmd":"pip install drf-jsonschema-serializer","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for Django projects and DRF integration (>=3.2)","package":"Django","optional":false},{"reason":"Core dependency for serializer introspection (>=3.12)","package":"djangorestframework","optional":false},{"reason":"Used for schema validation and generation (>=4.0)","package":"jsonschema","optional":false},{"reason":"Optional integration for OpenAPI schema generation, if desired","package":"drf-spectacular","optional":true}],"imports":[{"wrong":"from drf_jsonschema_serializer import JSONSchemaSerializer","symbol":"JSONSchemaSerializer","correct":"from drf_jsonschema_serializer import JSONSchemaSerializer"}],"quickstart":{"code":"from rest_framework import serializers\nfrom drf_jsonschema_serializer import JSONSchemaSerializer\n\nclass MyInputSerializer(serializers.Serializer):\n    name = serializers.CharField(max_length=100, help_text=\"The name of the item\")\n    quantity = serializers.IntegerField(min_value=1, help_text=\"The quantity of the item\")\n    is_active = serializers.BooleanField(default=True)\n\n# Instantiate the JSONSchemaSerializer with your DRF serializer\nschema_generator = JSONSchemaSerializer(MyInputSerializer())\n\n# Generate the JSON Schema\njson_schema = schema_generator.data\n\nprint(json_schema)\n# Example expected output (truncated):\n# {\n#   'type': 'object',\n#   'properties': {\n#     'name': {'type': 'string', 'maxLength': 100, 'description': 'The name of the item'},\n#     'quantity': {'type': 'integer', 'minimum': 1, 'description': 'The quantity of the item'},\n#     'is_active': {'type': 'boolean', 'default': True}\n#   },\n#   'required': ['name', 'quantity']\n# }","lang":"python","description":"This example demonstrates how to define a standard Django REST Framework serializer and then use `drf-jsonschema-serializer` to automatically generate its corresponding JSON Schema. The generated schema can be used for API documentation, client-side validation, or other schema-driven processes."},"warnings":[{"fix":"Upgrade Python to 3.10+, Django to 3.2+, and DRF to 3.12+ before installing or upgrading to drf-jsonschema-serializer v3.x.","message":"Version 3.0.0 drops support for Python < 3.10, Django < 3.2, and Django REST Framework < 3.12. Ensure your environment meets these minimum requirements before upgrading.","severity":"breaking","affected_versions":"3.0.0 and higher"},{"fix":"Replace `JSONSchemaField` with `JSONSchemaDictField` for dictionary-like schemas and `JSONSchemaListField` for list-like schemas. Update imports to `from drf_jsonschema_serializer.fields import JSONSchemaDictField, JSONSchemaListField`.","message":"The `JSONSchemaField` class was removed in version 3.0.0. If you were using it for dict or list fields within your DRF serializers, you must migrate to `JSONSchemaDictField` or `JSONSchemaListField` respectively.","severity":"breaking","affected_versions":"3.0.0 and higher"},{"fix":"If you require serving JSON Schemas via an API endpoint, consider using `drf-spectacular` for OpenAPI schema generation, or implement a custom view that utilizes `drf-jsonschema-serializer` directly to generate and serve the schema.","message":"The `JSONSchemaView` for serving schema endpoints was removed in v2.0.0. While this predates v3.0.0, users migrating from very old versions might encounter issues. The library now focuses purely on schema generation.","severity":"deprecated","affected_versions":"2.0.0 and higher"}],"env_vars":null,"search_vec":"'-12':38 '2020':37 '3.0':40 '3.0.0':48 'allow':20 'api':65 'api-document':64 'automat':10 'compat':42,57 'convert':31 'current':45 'defin':23 'develop':21 'django':15,58 'django/drf':55 'document':66 'draft':36 'drf':1,6,24,59 'drf-jsonschema-seri':5 'easili':30 'framework':17 'generat':13 'json':2,11,34,61 'json-schema':60 'jsonschema':7 'major':54 'openapi':39 'provid':9 'releas':50 'rest':16 'schema':3,12,35,43,62 'serial':4,8,18,25,63 'tie':52 'typic':51 'usual':27 'version':46,56 'x':41","created_at":"2026-04-17T01:20:17.683377+00:00","updated_at":"2026-04-17T01:20:17.683377+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp1219ljad/venv/lib/python3.12/site-packages/drf_jsonschema_serializer/__init__.py\", line 2, in <module>\n    from . import converters\n  File \"/tmp/tmp1219ljad/venv/lib/python3.12/site-packages/drf_jsonschema_seri"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.0.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/maykinmedia/drf-jsonschema-serializer","docs":"https://drf-jsonschema.readthedocs.io/en/stable/","changelog":"https://github.com/maykinmedia/drf-jsonschema-serializer/blob/main/docs/changelog.rst","pypi":"https://pypi.org/project/drf-jsonschema-serializer/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","web-framework","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}