From 28b387d3186e48680fcf53801b0ee5a657c7c32c Mon Sep 17 00:00:00 2001 From: Sri Charan Ratlan Date: Tue, 8 Sep 2026 14:03:12 +0530 Subject: [PATCH] chore(express): scaffold batched OpenAPI generation - Add a cumulative OpenAPI batch entrypoint for Express routes - Add the initial /api/v1/ping endpoint specification - Configure the docs updater for the openapi-express service - Target api-docs/services/openapi-express.yaml - Keep the workflow manual until the first batch is reviewed - Support adding additional endpoints incrementally in later PRs Ticket: WCI-1581 --- .github/workflows/update-api-docs.yaml | 26 +++++++++++++++++++ .../src/typedRoutes/api/openapi-index.ts | 14 ++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/update-api-docs.yaml create mode 100644 modules/express/src/typedRoutes/api/openapi-index.ts diff --git a/.github/workflows/update-api-docs.yaml b/.github/workflows/update-api-docs.yaml new file mode 100644 index 0000000000..644254dd70 --- /dev/null +++ b/.github/workflows/update-api-docs.yaml @@ -0,0 +1,26 @@ +--- +name: Update BitGo Express API docs + +# Kept manual until the first OpenAPI batch is added to openapi-index.ts. +on: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + +permissions: + contents: read + id-token: write + +jobs: + generate-and-update-api-docs: + uses: BitGo/gha-dev-portal-updater/.github/workflows/generate-and-update.yml@645bcc9d1e669f5b53eebc0121eede056569ca1a # v5.38.0 + with: + target-repo: api-docs + service-name: openapi-express + types-package-path: ./modules/express + api-spec-file: src/typedRoutes/api/openapi-index.ts + api-spec-title: BitGo Express API + codec-config-file: ./modules/express/openapi-generator.rc.js + remote-working-directory: '' + secrets: inherit diff --git a/modules/express/src/typedRoutes/api/openapi-index.ts b/modules/express/src/typedRoutes/api/openapi-index.ts new file mode 100644 index 0000000000..afb3a506be --- /dev/null +++ b/modules/express/src/typedRoutes/api/openapi-index.ts @@ -0,0 +1,14 @@ +import { apiSpec } from '@api-ts/io-ts-http'; +import { GetV1Ping } from './v1/ping'; + +/** + * Cumulative OpenAPI batch entrypoint. + * + * Add approved route specs here as they are introduced. Keep previously added + * routes in this object so generated/openapi-express.yaml remains cumulative. + */ +export const ExpressOpenApiSpec = apiSpec({ + 'express.v1.ping': { + get: GetV1Ping, + }, +});