feat: serve OpenAPI spec at <prefix>/__tapi/openapi.json#333
Open
mismosmi wants to merge 6 commits into
Open
Conversation
Accept `openapi: { title, version }` on `defineApi` and expose the
generated spec from the request handler when configured. Falls through
to normal route matching when the option is omitted.
https://claude.ai/code/session_01WFKtX6dLxJ1FCyQT2mpnPW
🦋 Changeset detectedLatest commit: 468ee6a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
Author
|
pick one of the examples and add an e2e test that verifies the openapi schema |
Enables openapi config on the contact-book api and adds a playwright dev e2e test that fetches /api/__tapi/openapi.json and asserts the served spec contains the configured info, the registered routes/methods, the dynamic path param, and the POST body schema. https://claude.ai/code/session_01WFKtX6dLxJ1FCyQT2mpnPW
Member
Author
|
bunny now serves the openapi spec from two different paths - /.well-know/openapi.json and /api/__tapi/openapi.json remove the well-known path. |
The OpenAPI spec is now served by tapi at /api/__tapi/openapi.json when
`openapi: { title, version }` is passed to `defineApi`. Removed the
duplicate Bunny-side serving from both dev and prod, along with the
now-unused `apiInfo` option on `createBunnyApp`.
https://claude.ai/code/session_01WFKtX6dLxJ1FCyQT2mpnPW
mismosmi
commented
May 26, 2026
|
|
||
| interface Options { | ||
| cache?: Cache; | ||
| openapi?: OpenAPIInfo; |
Member
Author
There was a problem hiding this comment.
rename this parameter to 'oas' instead of 'openapi'
Renames the user-facing config field on defineApi and the matching ApiDefinition field/type from openapi/OpenAPIInfo to oas/OasInfo, per review feedback. URL path and existing function names are unchanged. https://claude.ai/code/session_01WFKtX6dLxJ1FCyQT2mpnPW
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
openapi: { title: string; version: string }option todefineApi.GET <basePath>/__tapi/openapi.jsonreturns the spec produced by the existinggenerateOpenAPISchema(no behavior change to the schema itself).Usage
Test plan
create-request-handler.test.tscover: spec served with correct content-type and body when configured, 404 when not configured,basePathis respected, output is byte-identical across requests (memoization).pnpm --filter @farbenmeer/tapi test— 64/64 passing.pnpm --filter @farbenmeer/tapi build— typecheck passes.Notes
The original prompt referenced issue #326, but that issue is about asynchronous workflows. The branch name and task description make it clear the intended work was OpenAPI spec serving; this PR addresses that. Happy to retitle/relabel if a different issue is the right tracker.
https://claude.ai/code/session_01WFKtX6dLxJ1FCyQT2mpnPW
Generated by Claude Code