feat: add go api swagger docs#12
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Swagger UI support to the go-api template and updates CLI snapshot tests/fixtures to validate the new docs wiring and to avoid leaking volatile absolute paths in AI guide outputs.
Changes:
- Wire Swagger UI into the
go-apitemplate (/api/docs/*any) and document the docs endpoints in template guides/README. - Switch the template OpenAPI version to 3.0.3 (Swagger UI compatible) and adjust the
/api/docshandler to redirect to the UI. - Stabilize CLI snapshots by making
ai_guides.generated_filesworkspace-relative and scrubbing additional volatile error-context keys (cwd,package_json_path) in snapshot helpers/fixtures.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/templates/go-api/README.md.hbs | Documents Swagger UI and the OpenAPI YAML location. |
| packages/templates/go-api/internal/http/router.go.hbs | Adds gin-swagger routing for Swagger UI under /api/docs/*any. |
| packages/templates/go-api/internal/http/handlers/app_handler.go.hbs | Redirects /api/docs to /api/docs/index.html. |
| packages/templates/go-api/go.mod.hbs | Adds swaggo/files and swaggo/gin-swagger dependencies to the template. |
| packages/templates/go-api/CLAUDE.md | Updates agent guide to reference Swagger UI + correct router path. |
| packages/templates/go-api/api/openapi.yaml | Changes OpenAPI version header to 3.0.3. |
| packages/cli/testdata/reference/error-template-required.json | Replaces volatile absolute paths with <volatile> in fixture. |
| packages/cli/testdata/reference/error-template-not-found.json | Replaces volatile absolute paths with <volatile> in fixture. |
| packages/cli/testdata/reference/add-go-api.json | Updates snapshot to expect deterministic generated_files list. |
| packages/cli/internal/cli/snapshot_e2e_add_test.go | Adds assertions verifying rendered Swagger wiring + OpenAPI version. |
| packages/cli/internal/cli/e2e_helpers_test.go | Updates volatile key scrubbing rules for snapshots. |
| packages/cli/internal/ai/ai.go | Avoids absolute-path leakage in AI guides and returns relative generated_files. |
| packages/cli/internal/ai/ai_test.go | Adds regression test ensuring AI refresh doesn’t leak workspace absolute paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.