// the find
tfranzel/drf-spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
drf-spectacular is the de facto standard for generating OpenAPI 3 schemas from Django REST Framework. It replaces DRF's built-in schema generator, which has been essentially abandoned, and actually handles real-world APIs: polymorphic serializers, nested routers, per-action customization, and a long list of third-party package integrations. If you're running a DRF API and need accurate, usable OpenAPI output, this is the only serious option.
The @extend_schema decorator is well-designed — you can override request/response serializers per HTTP method on the same action, which is the exact thing DRF's native schema can't do. The third-party integration list is genuinely wide: SimpleJWT, django-filter, drf-nested-routers, Pydantic v2, camel-case, GIS — most of these have contrib modules with their own tests and YAML snapshots, so regressions get caught. Test coverage uses schema YAML snapshots as golden files, which means a schema change shows up as a diff in CI rather than a silent regression. The sidecar package for air-gapped environments is a practical detail that most tools miss.
The project explicitly refuses to commit to semver stability below 1.x, and any schema change — even a bug fix — can break downstream client generators. That's an honest policy, but it means pinning the version and diffing schema on every upgrade is non-optional busywork. The OpenAPI 3.1 support is available but gated behind a settings flag and still feels second-class compared to the mature 3.0 path. SerializerMethodField inference via type hints works, but falls back silently to a string type if annotations are missing or ambiguous — you won't know until a client breaks. The plumbing.py file (the core introspection machinery) is over 3,000 lines and essentially undocumented; extending it for unusual serializer patterns means reading a lot of dense code with no clear extension points.