docs: fix API drift in handler, openapi-reference, and link docs - #1756
Merged
Conversation
- handler.fetch() does not exist on FetchHandler; use handle() with
the { matched, response } result (rpc/handler, openapi/handler,
integrations/effect)
- OpenAPIReferencePlugin/generateSpec are v1 names; v2 uses
OpenAPIReferenceHandlerPlugin and generator.generate() with options
under base
- JsonifiedClient is exported from @orpc/openapi, not @orpc/contract
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/json-schema
@orpc/nest
@orpc/next
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
.fetch→.handlewithmatcheddestructuring —handler.fetch()doesn't exist in v2; all three affected doc files (rpc/handler.md,openapi/handler.md,integrations/effect.md) now use the correcthandler.handle()call with{ matched, response }and amatchedguard instead of the??fallback.OpenAPIReferencePlugin→OpenAPIReferenceHandlerPlugininplugins/openapi-reference.md— renamed in v2.generator.generateSpec()→generator.generate()with nestedbaseoption inplugins/openapi-reference.md— v2 API nestsinfo/serversunderbase: Partial<OpenAPIDocument>; now includesserversin the same snippet (was missing from the old bareinfo/serverscall).- Import fix in
openapi/link.md—JsonifiedClientis exported from@orpc/openapi, not@orpc/contract.
All five doc changes verified against current source exports. No remaining v1 drift.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
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.

Several v2 docs pages still showed v1 APIs that no longer exist, so copy-pasted snippets failed to compile. All snippets now match the actual v2 exports, verified against package source and playgrounds.
Fixes
handler.fetch(...)no longer exists onFetchHandler— snippets inrpc/handler.md,openapi/handler.md, andintegrations/effect.mdnow usehandler.handle(...)with the{ matched, response }result, matchingadapters/fetch-api.md.plugins/openapi-reference.mdnow uses the v2 namesOpenAPIReferenceHandlerPluginandgenerator.generate(...), withinfo/serversunder thebaseoption as the v2 generator expects.openapi/link.mdnow importsJsonifiedClientfrom@orpc/openapi, where it is actually exported — it does not exist in@orpc/contract.Testing
apps/content/docs/confirms no remaining occurrences ofhandler.fetch(,OpenAPIReferencePlugin, orgenerateSpec.