-
Notifications
You must be signed in to change notification settings - Fork 83
Remove merge-swagger.sh and simplify doc generation pipeline #1981
Copy link
Copy link
Open
Description
Context
The merge-swagger.sh script was originally created to merge separate Swagger specs from the onboarding and transaction modules into a unified spec. Since both modules have been consolidated into a single ledger component, the merge step is no longer necessary — swag init on the ledger component produces a complete spec directly.
Current pipeline
swag initgeneratesledger_swagger.jsonmerge-swagger.shpatches metadata (title, version, host, securityDefinitions), generatesdocs.gowith embedded JSON, converts to YAML, and cleans up intermediates
Proposed pipeline
swag init --outputTypes json,yamlgeneratesswagger.json,swagger.yaml, anddocs.godirectly — no post-processing
Changes needed
- Update
main.goswagger annotations:@title→Midaz Ledger API (Unified)@host→localhost:3002@description→ match current production description- Add
@securityDefinitions.apikey BearerAuth - Version should come from a single source (currently hardcoded in both
main.goand.env)
- Update
components/ledger/Makefilegenerate-docstarget to callswag initdirectly instead of the merge script - Delete
components/ledger/scripts/merge-swagger.sh - Regenerate specs and verify output matches current production spec
Notes
swagger.goalready supports runtime overrides via env vars (SWAGGER_TITLE,SWAGGER_HOST, etc.), so hardcoded defaults in annotations are safeopenapi.yaml(OAS 3.0) has no automated generation pipeline today — that's a separate concern- The
jqdependency for doc generation can be dropped after this change
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels