fiber icon indicating copy to clipboard operation
fiber copied to clipboard

🔥 feat: Add OpenAPI middleware

Open gaby opened this issue 4 months ago • 9 comments

Summary

  • auto-generate openapi.json file 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

gaby avatar Aug 21 '25 14:08 gaby

[!IMPORTANT]

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Aug 21 '25 14:08 coderabbitai[bot]

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.

codecov[bot] avatar Aug 21 '25 14:08 codecov[bot]

/gemini review

gaby avatar Aug 21 '25 14:08 gaby

[!WARNING] Gemini encountered an error creating the review. You can try again by commenting /gemini review.

gemini-code-assist[bot] avatar Aug 21 '25 14:08 gemini-code-assist[bot]

/gemini review

gaby avatar Aug 21 '25 14:08 gaby

nice feature, thx @gaby can you update and convert the DRAFT to READY (when it is ready for you)

ReneWerner87 avatar Oct 07 '25 10:10 ReneWerner87

/gemini review

gaby avatar Oct 25 '25 16:10 gaby

@codex review and suggest feature improvements.

gaby avatar Oct 25 '25 16:10 gaby

@codex review

gaby avatar Oct 25 '25 16:10 gaby