Skip to content

docs(API): add tags to swagger and order them based on workflow#6885

Merged
khvn26 merged 1 commit into
mainfrom
feat/add-swagger-tags
May 22, 2026
Merged

docs(API): add tags to swagger and order them based on workflow#6885
khvn26 merged 1 commit into
mainfrom
feat/add-swagger-tags

Conversation

@Holmus
Copy link
Copy Markdown
Contributor

@Holmus Holmus commented Mar 9, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

The Swagger UI at /api/v1/docs/ previously grouped all 443 operations under a single api tag, 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?

  1. Ran the full openapi unit test suite: pytest tests/unit/api/test_unit_openapi.py tests/unit/api/test_mcp_openapi.py
  2. Generated the schema locally and verified all 443 operations are assigned to the correct tags with zero unmatched operations.
  3. Verified the MCP schema generation still works correctly (postprocessing preserves explicit tags).
  4. Ran locally and visually verified result.

@Holmus Holmus requested a review from a team as a code owner March 9, 2026 15:24
@Holmus Holmus requested review from khvn26 and removed request for a team March 9, 2026 15:24
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 22, 2026 11:43am
flagsmith-frontend-preview Ignored Ignored Preview May 22, 2026 11:43am
flagsmith-frontend-staging Ignored Ignored Preview May 22, 2026 11:43am

Request Review

@github-actions github-actions Bot added api Issue related to the REST API feature New feature or request labels Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-6885 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-6885 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-6885 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6885 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6885 Finished ✅ Results

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_format in PREPROCESSING_HOOKS so the default format-suffix path deduplication is preserved alongside the custom hook.

Create PR

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": [
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread api/app/settings/common.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.50%. Comparing base (2be8504) to head (6b1171e).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6885      +/-   ##
==========================================
+ Coverage   98.49%   98.50%   +0.01%     
==========================================
  Files        1417     1430      +13     
  Lines       53749    54245     +496     
==========================================
+ Hits        52939    53435     +496     
  Misses        810      810              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  47.9 seconds
commit  23d07e2
info  🔄 Run: #15169 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 2 seconds
commit  23d07e2
info  🔄 Run: #15169 (attempt 1)

@Holmus Holmus force-pushed the feat/add-swagger-tags branch from 23d07e2 to 153d917 Compare May 22, 2026 11:21
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 22, 2026
@Holmus Holmus force-pushed the feat/add-swagger-tags branch from 153d917 to 4462255 Compare May 22, 2026 11:23
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.9 seconds
commit  153d917
info  🔄 Run: #16914 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.1 seconds
commit  153d917
info  🔄 Run: #16914 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  50 seconds
commit  153d917
info  🔄 Run: #16914 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.9 seconds
commit  4462255
info  🔄 Run: #16915 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.5 seconds
commit  4462255
info  🔄 Run: #16915 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  31.7 seconds
commit  4462255
info  🔄 Run: #16915 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  56.1 seconds
commit  4462255
info  🔄 Run: #16915 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 6 seconds
commit  153d917
info  🔄 Run: #16914 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Visual Regression

No baseline found — first run. Baselines will be generated after merge to main.
View full report

@khvn26 khvn26 changed the title feat: add tags to swagger and order them based on workflow docs(API): add tags to swagger and order them based on workflow May 22, 2026
khvn26
khvn26 previously approved these changes May 22, 2026
@khvn26
Copy link
Copy Markdown
Member

khvn26 commented May 22, 2026

@Holmus I'm happy to merge this once test coverage is fixed (see here), and run make generate-docs and commit the result (see failing check here).

@Holmus Holmus force-pushed the feat/add-swagger-tags branch from 4462255 to 5106363 Compare May 22, 2026 11:38
@Holmus Holmus requested a review from a team as a code owner May 22, 2026 11:38
@Holmus Holmus requested review from khvn26 and removed request for a team May 22, 2026 11:38
@github-actions github-actions Bot added docs Documentation updates and removed feature New feature or request labels May 22, 2026
@Holmus Holmus force-pushed the feat/add-swagger-tags branch from 5106363 to 6b1171e Compare May 22, 2026 11:43
@github-actions github-actions Bot added docs Documentation updates and removed docs Documentation updates labels May 22, 2026
@khvn26 khvn26 merged commit e79f066 into main May 22, 2026
39 of 52 checks passed
@khvn26 khvn26 deleted the feat/add-swagger-tags branch May 22, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants