feat(api-docs): Improve SDK API documentation#6626
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Contributor
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6626 +/- ##
=======================================
Coverage 98.18% 98.18%
=======================================
Files 1295 1294 -1
Lines 46920 46994 +74
=======================================
+ Hits 46067 46141 +74
Misses 853 853 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
emyller
previously approved these changes
Jan 30, 2026
Contributor
emyller
left a comment
There was a problem hiding this comment.
Looks solid! Non-blocking comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #6341.
In this PR, we improve the SDK API documentation, decoupling it from the flagsmith-engine's legacy code.
flagsmith_schemasintegration for OpenAPI generationTypedDictin schema generationsecuritySchemescorrectlyHow did you test this code?
CI,
make -C docs serve.How to review this PR
This PR contains three distinct types of changes:
1. Python code architecture changes
The backend moves from Django REST serializers and legacy engine's Pydantic models to using
flagsmith_schemasas the single source of truth for API contracts.Key files to examine:
api/api/openapi.py: existing tooling for Pydantic models repurposed forTypedDicts. Added generation code for authentication classes used in our viewsapi/environments/identities/serializers.py&views.py: Modified to align with schema definitionsapi/tests/integration/sdk/test_sdk_api_schemas.py: New integration tests that validate actual API responses againstflagsmith_schemas.apitypes using Pydantic'sTypeAdapterWhat got deleted and why:
api/environments/sdk/schemas.py: Redundant, replaced byflagsmith_schemasapi/util/pydantic.py: Custom Pydantic utilities no longer needed2. OpenAPI spec generation tooling
New infrastructure for generating SDK API documentation from the backend code.
Core components:
sdk/openapi.yaml: The generated OpenAPI spec describing SDK endpoints. Can be ignored unless you're really interested in how generation works.api/openapi-filter-flagsmith-sdk.yml: Filter configuration that extracts only SDK endpoints from the full API specapi/Makefile&docs/Makefile: Newgenerate-sdk-api-docstarget that runs the generation pipelineGeneration flow to verify:
sdktag get removed)sdk/openapi.yamlmake -C docs build)3. Documentation migration
Complete replacement of Edge API docs with SDK API docs, plus fixing all internal references. This part is responsible for a significant chunk of the diff as the generated docs are replaced and shuffled around.
Documentation structure change:
/docs/edge-api/*(6 files deleted)/docs/sdk-api/*(6 files created) — suggest to ignore these and check the deployed, or locally served, docs instead.sdk/openapi.yamlrather than hand-written schemaLink updates across the docs:
docs/vercel.json: Redirects from/edge-api/*to/sdk-api/*paths.mdfiles: Updated references from "Edge API" to "SDK API"docusaurus.config.ts: Plugin configuration for the new SDK API documentationFollow-up issues
/api/v1/bulk-identitiesin Core API #6628 — eliminate discrepancy between Core and Edge APIs. More context here.Tokenauthentication in Core API #6629 — surfaced after adding autogeneration for OpenAPI security schemes.