Skip to content

ci: add OpenAPI spec export to CI pipeline #40

@snowrugar-beep

Description

@snowrugar-beep

Problem Statement

Swagger is configured at runtime (accessible via /api/docs) but no CI step exports the OpenAPI JSON spec as an artifact.

Evidence

  • Backend/src/main.ts — SwaggerModule.createDocument generates the spec
  • No CI step to export and upload openapi.json

Impact

API consumers must run the application to get the OpenAPI spec. No spec available in CI artifacts for documentation generation.

Proposed Solution

  1. Add CI step that starts the application and fetches Swagger JSON
  2. Export the spec as openapi.json artifact
  3. Add to API docs generation pipeline

Technical Requirements

  • Must use the same Swagger config as the application
  • Must export both JSON and YAML formats

Acceptance Criteria

  1. CI step generates openapi.json
  2. Artifact is available for download
  3. Spec matches the runtime Swagger documentation

File Inventory

  • infrastructure/ci/docker-build-pipeline.yml
  • infrastructure/ci/docs-generation.yml

Dependencies

Issue #23 (API versioning) — spec should match final routes.

Testing Strategy

  • Compare CI-generated spec with runtime spec

Security Considerations

OpenAPI spec should not expose internal endpoint details that could aid attackers.

Definition of Done

  • CI exports OpenAPI spec
  • Artifact available
  • Spec matches runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions