Skip to content

feat(api): publish a typed API client package for docforum-web from the OpenAPI spec - #239

Merged
afeezorobsco-cyber merged 3 commits into
DocForum:mainfrom
dunnidev:feat/publish-a-typed-api-client-package-for-docforum
Oct 23, 2026
Merged

afeezorobsco-cyber merged 3 commits into
DocForum:mainfrom
dunnidev:feat/publish-a-typed-api-client-package-for-docforum

Conversation

@dunnidev

@dunnidev dunnidev commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Publishes @docforum/api-client, a versioned, generated TypeScript client derived from the DocForum OpenAPI spec. This removes hand-mirrored backend shapes from docforum-web's src/types/models.ts, turns contract drift into compile-time errors, and follows the same GitHub Release tarball publishing mechanism as @docforum/escrow-sdk (ADR 0003 in docforum-escrow).

Changes

  • backend/openapi.json — Versioned OpenAPI 3 spec generated from the backend routes, mirroring docs/api/README.md
  • backend/scripts/gen-openapi.mjs — Regenerates the spec and runs openapi-typescript to produce generated types (idempotent, never hand-edited)
  • packages/api-client/ (new) — @docforum/api-client package containing generated types (// DO NOT EDIT) and a thin fetch-based client. No Node-only dependencies, browser-safe. Built to dist/.
  • .github/workflows/release-api-client.yml — On version tags, builds and publishes api-client-<version>.tgz as a GitHub Release asset
  • changelog.d/164-typed-api-client.md — Changelog entry (one per breaking change; versioned with the API)
  • docs/api/README.md — References the OpenAPI spec
  • ROADMAP.md — Updated per changelog workflow

Testing

  • backend/ — npm run typecheck, npm test, npm run test:integration all pass (booking, referral, order, and payment integration flows verified)
  • packages/api-client/ — npm ci && npm run build succeeds with no Node-only imports
  • Regeneration via backend/scripts/gen-openapi.mjs produces no unintended diffs
  • Release workflow builds and uploads the tarball asset on tag
  • CI green

Adoption

Tracking issue opened in docforum-web to adopt @docforum/api-client

Closes #113

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Malware scan: passed, with notes for the reviewer

Nothing malicious was detected in ebc5706. These changes touch sensitive areas and should get a careful look before CI is approved:

Where Rule Why
.github/workflows/release-api-client.yml:1 workflow-change Changes a CI workflow; a maintainer must review before approving runs.
.github/workflows/release-api-client.yml:37 workflow-secret Workflow uses a repository secret.

@afeezorobsco-cyber afeezorobsco-cyber 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.

Reviewed: no malicious code found, CI is green. Merging.

@afeezorobsco-cyber
afeezorobsco-cyber merged commit 5adb548 into DocForum:main Oct 23, 2026
2 checks passed
nasirudeenbadirudeen87-cloud pushed a commit to nasirudeenbadirudeen87-cloud/docforum-core that referenced this pull request Oct 26, 2026
…api.json

The OpenAPI generator from DocForum#112 landed on main (DocForum#239) and writes
backend/openapi.json, so point the docs-site sync at that path instead of
the never-created docs/api/openapi.json. The docs build now succeeds.
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.

[Phase 9] Publish a typed API client package for docforum-web from the OpenAPI spec

2 participants