Skip to content

Conversation

jordane
Copy link
Contributor

@jordane jordane commented Aug 27, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 21:19
@jordane jordane requested a review from a team as a code owner August 27, 2025 21:19
Copy link

coderabbitai bot commented Aug 27, 2025

Walkthrough

Per-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

Cohort / File(s) Summary of Changes
Goa DSL static OpenAPI file endpoints
api/project/v1/design/project.go
Updated four Files declarations for /_projects/openapi.{json,yaml} and /_projects/openapi3.{json,yaml} to the three-argument form, adding inline funcs that set Meta("swagger:generate", "false") to disable Swagger generation per file.

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jme/fix-openapi-spec

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a 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.

Copy link

@coderabbitai coderabbitai bot left a 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: Prefer openapi:generate over legacy swagger:generate; verify exclusion from OpenAPI 3 output

In Goa v3 the OpenAPI generator honors Meta("openapi:generate", "false"). The swagger:* 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 to openapi:generate and re-gen to confirm the four paths are gone from gen/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 mapping

The comment references serving openapi3.json at /openapi.json, but the code serves /\_projects/openapi.json from gen/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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f50b3f and 63bf1cc.

⛔ 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

@jordane jordane merged commit 6202c61 into main Aug 28, 2025
6 checks passed
@jordane jordane deleted the jme/fix-openapi-spec branch August 28, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants