Skip to content

Publish Versioned OpenAPI Spec as Build Artefact #1697

Description

@RUKAYAT-CODER

Overview

swagger.config.ts generates the OpenAPI spec at runtime only. There is no versioned JSON spec checked into the repo or published as a CI artefact, making API integration harder for frontend and third-party consumers.

Background

The spec should be generated during the build step and saved as openapi.json. It should also be versioned alongside the code so breaking changes are visible in PRs.

Specifications

Features:

pm run generate:openapi script that writes docs/openapi.json`n- CI step uploads the spec as a build artefact

  • Spec version pinned to the app version in package.json`n

Tasks:

  • Add generate:openapi script using NestJS CLI
  • Add CI step to generate and upload spec
  • Add spec diff check to PR CI to flag breaking changes

Impacted Files:

  • BackEnd/package.jsonn- .github/workflows/ci.ymln- BackEnd/docs/openapi.json (generated)

Acceptance Criteria:

  • docs/openapi.json is generated and committed during CI
  • PR diff shows API changes clearly

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignStellar WaveIssues in the Stellar wave programbackendenhancementNew feature or request

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