Generate OpenAPI 3.1 document from the zod contracts (GET /api/v1/openapi.json) - #5
Merged
Conversation
Roadmap Phase 4 item ("OpenAPI from zod"). Lets third parties integrate or
generate clients without the TypeScript package.
- core/contracts: `buildOpenApiDocument()` — component schemas produced by
`z.toJSONSchema` (JSON Schema 2020-12, which OpenAPI 3.1 adopts) so they can't
drift from the runtime validators; paths are a thin hand-authored map over
those components. Covers the full v1 surface. Public endpoints marked
security-free; Clerk bearer scheme documented. 5 unit tests.
- web: public `GET /api/v1/openapi.json`.
- api-client: `getOpenApiDocument()`.
- docs: docs/api.md endpoint.
Verification: 99 tests pass (87 core incl. 5 new + 12 bot); typecheck + lint
clean across all workspaces.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Roadmap Phase 4 item ("OpenAPI from zod"). Third parties can now integrate or generate a client without the TypeScript package.
buildOpenApiDocument()(core/contracts) — component schemas are produced byz.toJSONSchemafrom the very schemas the server validates against (JSON Schema 2020-12, which OpenAPI 3.1 adopts wholesale), so the spec cannot drift from the runtime validators. Paths are a thin hand-authored map over those components, covering the full v1 surface (accounts incl. bulk-edit, balances, sync, goals, activity, expiring, export/import, calendar, assistant, value-advice, deals, shares, demo, restore). Public endpoints are markedsecurity: []; the Clerk bearer scheme is documented. Framework-free (zod only).GET /api/v1/openapi.json.getOpenApiDocument().docs/api.mdentry.Verification
Independent of the other open work — different files.
🤖 Generated with Claude Code