Skip to content

ci: export OpenAPI spec as CI artifact (#40)#82

Merged
snowrugar-beep merged 2 commits into
VertexChainLabs:mainfrom
temisan0x:ci/openapi-spec-export
Jun 24, 2026
Merged

ci: export OpenAPI spec as CI artifact (#40)#82
snowrugar-beep merged 2 commits into
VertexChainLabs:mainfrom
temisan0x:ci/openapi-spec-export

Conversation

@temisan0x

Copy link
Copy Markdown
Contributor

Closes #40

What this does

Adds a CI step that programmatically exports the NestJS Swagger spec as downloadable artifacts (openapi.json and openapi.yaml), replacing the hardcoded stub in generate-api-docs.sh.

Changes

  • Backend/src/export-spec.ts — headless NestJS bootstrap; builds the Swagger document and writes both formats to infrastructure/docs/
  • Backend/package.json — adds export-spec script (ts-node -r tsconfig-paths/register src/export-spec.ts)
  • infrastructure/scripts/generate-api-docs.sh — replaces hardcoded stub heredoc with npm run export-spec
  • infrastructure/ci/docs-generation.yml — adds Node 20 setup, npm ci, Postgres 15 service container, correct DATABASE_* env vars, and artifact upload for openapi-spec

Why Postgres

AppModule initialises TypeORM on app.init(). A Postgres 15 service container is added to the generate-api-docs job — no migrations run, no tables required, just a live connection. Credentials are isolated to this job and do not affect other CI jobs.

Notes

  • Output paths in export-spec.ts are anchored to __dirname, not cwd, so files always land at repo-root infrastructure/docs/ regardless of where the script is invoked from
  • Spec metadata (title, description, version) matches main.ts
  • app.listen() is never called — headless export only

Copy link
Copy Markdown
Contributor

Great work @temisan0x! 🎉 Replacing the stubbed OpenAPI artifact with a real headless Swagger export is a really nice developer-experience win — and the extract-spec.ts script keeps it reproducible. CI is green, merging to resolve #40.

Resolve package.json conflicts by keeping OpenAPI export deps alongside upstream Redis and sanitize-html changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@temisan0x temisan0x force-pushed the ci/openapi-spec-export branch from 50d3e84 to 76b29dd Compare June 23, 2026 15:21
@temisan0x

Copy link
Copy Markdown
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).

@snowrugar-beep snowrugar-beep 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.

LGTM

@snowrugar-beep snowrugar-beep merged commit 997c18c into VertexChainLabs:main Jun 24, 2026
6 checks passed
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.

ci: add OpenAPI spec export to CI pipeline

2 participants