Skip to content

[LFXV2-1291] feat: add OpenAPI spec endpoints for API documentation#12

Merged
andrest50 merged 1 commit intomainfrom
andrest50/api-docs
Mar 16, 2026
Merged

[LFXV2-1291] feat: add OpenAPI spec endpoints for API documentation#12
andrest50 merged 1 commit intomainfrom
andrest50/api-docs

Conversation

@andrest50
Copy link
Contributor

@andrest50 andrest50 commented Mar 16, 2026

Summary

  • 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

Ticket

LFXV2-1291

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings March 16, 2026 20:02
Copy link

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

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 openapi service that serves generated spec files at /_survey/openapi{,3}.{json,yaml} and regenerate Goa output.
  • Wire the generated OpenAPI file server into cmd/survey-api and add kodata links 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.

@andrest50 andrest50 merged commit 4d8cfd4 into main Mar 16, 2026
9 checks passed
@andrest50 andrest50 deleted the andrest50/api-docs branch March 16, 2026 21:19
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.

3 participants