Skip to content

feat: add go api swagger docs#12

Merged
caorushizi merged 1 commit into
masterfrom
codex/go-api-swagger-ai-guides
Jun 16, 2026
Merged

feat: add go api swagger docs#12
caorushizi merged 1 commit into
masterfrom
codex/go-api-swagger-ai-guides

Conversation

@caorushizi

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 16, 2026 22:05
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
one-cli-docs Ready Ready Preview, Comment Jun 16, 2026 10:05pm

@caorushizi
caorushizi merged commit 3ac7204 into master Jun 16, 2026
7 checks passed
@caorushizi
caorushizi deleted the codex/go-api-swagger-ai-guides branch June 16, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-api template (/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/docs handler to redirect to the UI.
  • Stabilize CLI snapshots by making ai_guides.generated_files workspace-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.

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