feat: add tags to swagger and order them based on workflow#6885
feat: add tags to swagger and order them based on workflow#6885
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Default preprocessing hook dropped when overriding PREPROCESSING_HOOKS
- I restored
drf_spectacular.hooks.preprocess_exclude_path_formatinPREPROCESSING_HOOKSso the default format-suffix path deduplication is preserved alongside the custom hook.
- I restored
Or push these changes by commenting:
@cursor push bb2444f165
Preview (bb2444f165)
diff --git a/api/app/settings/common.py b/api/app/settings/common.py
--- a/api/app/settings/common.py
+++ b/api/app/settings/common.py
@@ -543,6 +543,7 @@
"environments.identities.traits.openapi",
],
"PREPROCESSING_HOOKS": [
+ "drf_spectacular.hooks.preprocess_exclude_path_format",
"api.openapi.preprocessing_filter_spec",
],
"POSTPROCESSING_HOOKS": [| ], | ||
| "PREPROCESSING_HOOKS": [ | ||
| "api.openapi.preprocessing_filter_spec", | ||
| ], |
There was a problem hiding this comment.
Default preprocessing hook dropped when overriding PREPROCESSING_HOOKS
Medium Severity
The POSTPROCESSING_HOOKS correctly re-includes the drf-spectacular default drf_spectacular.hooks.postprocess_schema_enums, but PREPROCESSING_HOOKS does not re-include the default drf_spectacular.hooks.preprocess_exclude_path_format. That default hook filters out format-suffixed path duplicates (e.g. .json/.api variants). Overriding the setting with only the new preprocessing_filter_spec hook silently drops it, potentially causing duplicate or format-suffixed paths to appear in the generated schema.
There was a problem hiding this comment.
The default value for PREPROCESSING_HOOKS in drf-spectacular is [], preprocess_exclude_path_format is only listed as an example in the docs, not included by default. So we're not dropping any existing behaviour here.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6885 +/- ##
==========================================
- Coverage 98.33% 98.25% -0.09%
==========================================
Files 1334 1334
Lines 49661 49545 -116
==========================================
- Hits 48836 48681 -155
- Misses 825 864 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
|
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|



Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
The Swagger UI at
/api/v1/docs/previously grouped all 443 operations under a singleapitag, making it difficult to navigate. This PR adds logical tag grouping via drf-spectacular preprocessing and postprocessing hooks, splitting operations into 20 sections based on URL path patterns (e.g. Organisations, Projects, Features, Integrations). Operations with explicit tags (sdk, mcp, experimental) are left unchanged. The Swagger UI now displays sections in workflow order - Authentication first, then core resources, then configuration/admin.How did you test this code?
pytest tests/unit/api/test_unit_openapi.py tests/unit/api/test_mcp_openapi.py