ci: export OpenAPI spec as CI artifact (#40)#82
Merged
snowrugar-beep merged 2 commits intoJun 24, 2026
Conversation
Contributor
|
Great work @temisan0x! 🎉 Replacing the stubbed OpenAPI artifact with a real headless Swagger export is a really nice developer-experience win — and the |
Resolve package.json conflicts by keeping OpenAPI export deps alongside upstream Redis and sanitize-html changes. Co-authored-by: Cursor <cursoragent@cursor.com>
50d3e84 to
76b29dd
Compare
Contributor
Author
|
@snowrugar-beep Thanks for the review and for approving this! The merge conflicts in Backend/package.json and Backend/package-lock.json are resolved — I rebased onto latest main and kept both sides of the dependency changes (js-yaml for the OpenAPI export, plus upstream’s ioredis and sanitize-html from #86 and #69). |
3 tasks
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.
Closes #40
What this does
Adds a CI step that programmatically exports the NestJS Swagger spec as downloadable artifacts (
openapi.jsonandopenapi.yaml), replacing the hardcoded stub ingenerate-api-docs.sh.Changes
Backend/src/export-spec.ts— headless NestJS bootstrap; builds the Swagger document and writes both formats toinfrastructure/docs/Backend/package.json— addsexport-specscript (ts-node -r tsconfig-paths/register src/export-spec.ts)infrastructure/scripts/generate-api-docs.sh— replaces hardcoded stub heredoc withnpm run export-specinfrastructure/ci/docs-generation.yml— adds Node 20 setup,npm ci, Postgres 15 service container, correctDATABASE_*env vars, and artifact upload foropenapi-specWhy Postgres
AppModuleinitialises TypeORM onapp.init(). A Postgres 15 service container is added to thegenerate-api-docsjob — no migrations run, no tables required, just a live connection. Credentials are isolated to this job and do not affect other CI jobs.Notes
export-spec.tsare anchored to__dirname, notcwd, so files always land at repo-rootinfrastructure/docs/regardless of where the script is invoked frommain.tsapp.listen()is never called — headless export only