[LFXV2-1291] feat: add OpenAPI spec endpoints for API documentation#12
Merged
[LFXV2-1291] feat: add OpenAPI spec endpoints for API documentation#12
Conversation
- Add Files() declarations to Goa design for /_survey/openapi.{json,yaml} and /_survey/openapi3.{json,yaml}
- Regenerate API code (gen/http/openapi/ server package) via make apigen
- Wire openapi server into main.go with KO_DATA_PATH support for ko bundling
- Create cmd/survey-api/kodata/gen/http/ symlinks so specs are bundled in the container image
- Add /_survey/ path rule to httproute.yaml so docs are publicly accessible
- Update .mega-linter.yml and .yamllint to exclude kodata directory
- Update README with links to deployed dev and production API docs, and ITX upstream docs
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Signed-off-by: Andres Tobon <andrest2455@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds publicly reachable OpenAPI/Swagger spec file endpoints for the Survey API and wires them into the service + deployment configuration so documentation can be served from the running container (including ko bundling support).
Changes:
- Add a Goa
openapiservice that serves generated spec files at/_survey/openapi{,3}.{json,yaml}and regenerate Goa output. - Wire the generated OpenAPI file server into
cmd/survey-apiand addkodatalinks to ensure specs are bundled into the container image. - Update Gateway HTTPRoute, linting exclusions, and README documentation links.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| gen/openapi/service.go | Generated Goa service interface/constants for the new openapi service. |
| gen/openapi/endpoints.go | Generated endpoint wrapper for openapi (file-serving only). |
| gen/openapi/client.go | Generated client stub for openapi. |
| gen/http/openapi3.yaml | Regenerated OpenAPI 3 spec; adds openapi tag. |
| gen/http/openapi3.json | Regenerated OpenAPI 3 JSON spec; adds openapi tag. |
| gen/http/openapi/server/types.go | Generated HTTP server types for openapi. |
| gen/http/openapi/server/server.go | Generated HTTP file server + mounting for OpenAPI spec endpoints. |
| gen/http/openapi/server/paths.go | Generated path constructors (empty for file-serving). |
| gen/http/openapi/client/types.go | Generated HTTP client types for openapi. |
| gen/http/openapi/client/paths.go | Generated client path constructors. |
| gen/http/openapi/client/encode_decode.go | Generated encode/decode scaffolding. |
| gen/http/openapi/client/client.go | Generated HTTP transport client scaffold. |
| cmd/survey-api/main.go | Mounts the OpenAPI spec server and attempts to resolve KO_DATA_PATH. |
| cmd/survey-api/kodata/gen/http/openapi3.yaml | kodata link/entry for bundling OpenAPI 3 YAML. |
| cmd/survey-api/kodata/gen/http/openapi3.json | kodata link/entry for bundling OpenAPI 3 JSON. |
| cmd/survey-api/kodata/gen/http/openapi.yaml | kodata link/entry for bundling OpenAPI (v2) YAML. |
| cmd/survey-api/kodata/gen/http/openapi.json | kodata link/entry for bundling OpenAPI (v2) JSON. |
| charts/lfx-v2-survey-service/templates/httproute.yaml | Adds /_survey/ PathPrefix match to route traffic to the service. |
| api/survey/v1/design/survey.go | Adds Goa Files() declarations for the spec endpoints. |
| README.md | Updates documentation section with deployed docs links. |
| .yamllint | Excludes cmd/survey-api/kodata/ from yamllint. |
| .mega-linter.yml | Excludes kodata from some linters/scans and updates regex filters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jordane
approved these changes
Mar 16, 2026
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.
Summary
Files()declarations to Goa design for/_survey/openapi.{json,yaml}and/_survey/openapi3.{json,yaml}gen/http/openapi/server package) viamake apigenmain.gowithKO_DATA_PATHsupport for ko bundlingcmd/survey-api/kodata/gen/http/symlinks so specs are bundled in the container image/_survey/path rule tohttproute.yamlso docs are publicly accessible.mega-linter.ymland.yamllintto exclude kodata directoryTicket
LFXV2-1291
🤖 Generated with Claude Code