-
Notifications
You must be signed in to change notification settings - Fork 3
do not generate openapi spec for openapi files #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jordan Evans <[email protected]>
WalkthroughPer-file metadata was added to four static OpenAPI file endpoints in Goa DSL by converting two-argument Files calls to three-argument variants that include Meta("swagger:generate", "false"), disabling Swagger generation for those endpoints in api/project/v1/design/project.go. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request removes auto-generated OpenAPI specification endpoints from the API specification files to prevent recursive generation. The change ensures that OpenAPI file serving endpoints do not appear in the generated OpenAPI specifications themselves.
- Removes OpenAPI file endpoints from generated specifications (openapi.json, openapi.yaml, openapi3.json, openapi3.yaml)
- Adds metadata to exclude OpenAPI file serving endpoints from specification generation
- Prevents circular references in API documentation
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
api/project/v1/gen/http/openapi3.yaml | Removes OpenAPI file endpoint definitions from OpenAPI 3.0 specification |
api/project/v1/gen/http/openapi.yaml | Removes OpenAPI file endpoint definitions from OpenAPI 2.0 specification |
api/project/v1/gen/http/openapi.json | Removes OpenAPI file endpoint definitions from JSON specification |
api/project/v1/design/project.go | Adds metadata to exclude OpenAPI file endpoints from specification generation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
api/project/v1/design/project.go (2)
351-362
: Preferopenapi:generate
over legacyswagger:generate
; verify exclusion from OpenAPI 3 outputIn Goa v3 the OpenAPI generator honors
Meta("openapi:generate", "false")
. Theswagger:*
keys are from older docs and may not affect OpenAPI v3 output consistently. To ensure these static file routes are excluded from both JSON and YAML OpenAPI 3 specs, switch toopenapi:generate
and re-gen to confirm the four paths are gone fromgen/http/openapi3.{json,yaml}
. (goa.design)Apply this diff within the touched block:
Files("/_projects/openapi.json", "gen/http/openapi.json", func() { - Meta("swagger:generate", "false") + Meta("openapi:generate", "false") }) Files("/_projects/openapi.yaml", "gen/http/openapi.yaml", func() { - Meta("swagger:generate", "false") + Meta("openapi:generate", "false") }) Files("/_projects/openapi3.json", "gen/http/openapi3.json", func() { - Meta("swagger:generate", "false") + Meta("openapi:generate", "false") }) Files("/_projects/openapi3.yaml", "gen/http/openapi3.yaml", func() { - Meta("swagger:generate", "false") + Meta("openapi:generate", "false") })After regenerating, please confirm the four “/_projects/openapi…” paths are absent from
gen/http/openapi3.yaml
(and.json
).
350-350
: Stale comment vs. actual mappingThe comment references serving
openapi3.json
at/openapi.json
, but the code serves/\_projects/openapi.json
fromgen/http/openapi.json
. Update the comment for accuracy.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
api/project/v1/gen/http/openapi.json
is excluded by!**/gen/**
api/project/v1/gen/http/openapi.yaml
is excluded by!**/gen/**
api/project/v1/gen/http/openapi3.json
is excluded by!**/gen/**
api/project/v1/gen/http/openapi3.yaml
is excluded by!**/gen/**
📒 Files selected for processing (1)
api/project/v1/design/project.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: MegaLinter
No description provided.