Implement fix for issue 6183
Thanks for submitting a PR! Please check the boxes below:
- [ ] I have added information to
docs/if required so people know about the feature! - [x] I have filled in the "Changes" section below?
- [x] I have filled in the "How did you test this code" section below?
- [x] I have used a Conventional Commit title for this Pull Request
Changes
This PR migrates the API documentation from drf-yasg to drf-spectacular to provide an OpenAPI 3.0 compliant schema, addressing issue #6183 and building on PR #6184.
Key changes include:
- Replaced
drf-yasgwithdrf-spectacularfor schema generation and UI. - Introduced new schema and docs endpoints while maintaining backward compatibility for existing
/swagger.json,/swagger.yaml, and/docs/paths. - Configured
drf-spectacularsettings, including security schemes and permissions. - Updated serializer fields (e.g.,
EdgeFeatureField) to usedrf-spectacular's@extend_schema_fieldfor union types. - Fixed an edge case in
CreateUpdateEnvironmentSerializerto guardself.instanceaccess. - Added
drf-spectaculartopyproject.toml.
How did you test this code?
I tested this code manually by:
- Accessing the new OpenAPI 3 schema:
GET /api/v1/docs/?format=openapi - Verifying the new Swagger UI:
GET /api/v1/docs/ - Confirming backward compatibility for existing schema endpoints:
-
GET /api/v1/swagger.json -
GET /api/v1/swagger.yaml
-
- Checking the new dedicated schema endpoint:
GET /api/v1/schema/
Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| flagsmith-frontend-preview | Preview | Comment | Oct 22, 2025 3:39pm | |
| flagsmith-frontend-staging | Preview | Comment | Oct 22, 2025 3:39pm |
@cursor make the tests green. Use Cursor's Github app access to view test checks result. If you choose to run the tests yourself, use make test opts='-k <pytest filter>' and make test opts='--lf'. to isolate the test run to failing tests.
❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.
Please try again later or check the agent status.
Learn more about Cursor Agents
Okay, Cursor's background agent is unresponsive now. I want to keep this work in a background agent, so we might hold this off until we start trying Claude Code out. CC @matthewelwell