Repository navigation
fix(API): Declare list responses as arrays in the OpenAPI schema - #9225
Open
anishmehta24 wants to merge 1 commit into
Open
anishmehta24 wants to merge 1 commit into
anishmehta24 wants to merge 1 commit into
Conversation
list_projects_in_organization, list_project_environments, get_feature_code_references and get_feature_evaluation_data return a JSON array, but the schema declared a single object.
|
@anishmehta24 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
No issues found across 7 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because this PR is from an external contributor.
Re-trigger cubic
This branch has not been deployed
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. (Not needed: responses are unchanged.)Changes
Contributes to #7679 (point 2).
These endpoints return a JSON array, but the OpenAPI schema declared a single object, so the MCP tools built from it carry the wrong output schema:
list_projects_in_organization: declaredOrganisationSerializerFull, returns a list ofProjectListlist_project_environments: declaredProjectList, returns a list ofEnvironmentSerializerLightget_feature_code_references: returns a list ofFeatureFlagCodeReferencesRepositorySummaryget_feature_evaluation_data: returns a list ofFeatureEvaluationDataEach one now declares its serializer with
many=True.pagination_class=Nonestops drf-spectacular from wrapping the array in a paginated envelope, since none of these views paginate. API responses don't change.openapi.yamlandmcp/src/flagsmith_mcp/openapi.jsonare updated to match.make generate-full-openapineeds the private packages, so I diffedmanage.py spectacularoutput before and after the change (only these four responses differ), applied that toopenapi.yaml, then ranmake generate-mcp-openapi. Worth re-runningmake generate-docs-privateon your side to confirm there's no drift.How did you test this code?
test_api_documentation_specification__endpoint_returns_a_list__documents_array_responsetotests/integration/test_api_documentation.py. It fails on main for all four endpoints and passes with the change.pytest tests/integration/test_api_documentation.py tests/unit/api tests/unit/projects tests/unit/organisations/test_unit_organisations_views.py tests/unit/features/test_unit_features_views.pypasses (Linux, Postgres 16).make testandmypypass with the regeneratedopenapi.json.ruff check,ruff format --checkandmypyon the changed Python files are clean.