🔥 feat: Add OpenAPI middleware
Summary
- auto-generate
openapi.jsonfile from app router - support per-operation IDs, tags, and deprecation metadata in the OpenAPI middleware
- serve specs from grouped routes and verify raw JSON output in new tests
- assert middleware JSON matches a fixture to guard against regressions
Fixes #2347 #1297 #3118
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
2025-08-21-14-48-18
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Codecov Report
:x: Patch coverage is 81.55556% with 83 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 91.63%. Comparing base (8fc239f) to head (2bab831).
:warning: Report is 133 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| middleware/openapi/openapi.go | 80.68% | 26 Missing and 19 partials :warning: |
| router.go | 57.69% | 22 Missing :warning: |
| app.go | 86.55% | 10 Missing and 6 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3702 +/- ##
==========================================
- Coverage 91.81% 91.63% -0.19%
==========================================
Files 114 117 +3
Lines 11498 10109 -1389
==========================================
- Hits 10557 9263 -1294
+ Misses 681 548 -133
- Partials 260 298 +38
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 91.63% <81.55%> (-0.19%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
/gemini review
[!WARNING] Gemini encountered an error creating the review. You can try again by commenting
/gemini review.
/gemini review
nice feature, thx @gaby can you update and convert the DRAFT to READY (when it is ready for you)
/gemini review
@codex review and suggest feature improvements.
@codex review