You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(rpc,openapi): add end-to-end HTTP QUERY support (#1844)
Fixes#1841
This PR adds end-to-end support for the HTTP `QUERY` method across oRPC
RPC links, OpenAPI routes, request deduplication, batching, CORS, and
tests.
[`QUERY` is defined by RFC
10008](https://www.rfc-editor.org/rfc/rfc10008.html) as a safe and
idempotent method that carries query input in the request body. It fills
the gap between `GET`, which is safe but puts input in the URL, and
`POST`, which supports a body but does not communicate safe or
idempotent semantics.
---------
Co-authored-by: Dinh Le <dinwwwh@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: apps/content/docs/openapi/specification.mdx
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ In this example, the final `tags` is `undefined`, so no tags are applied to `exa
131
131
132
132
## OpenAPI Generator
133
133
134
-
`OpenAPIGenerator` accepts either a [contract](/docs/contract/router) or a [router](/docs/router) and generates an OpenAPI 3.1 document.
134
+
`OpenAPIGenerator` accepts either a [contract](/docs/contract/router) or a [router](/docs/router) and generates an OpenAPI 3.1 document by default. OpenAPI 3.2 is partially supported.
If your router contains a procedure that uses the `QUERY` method, explicitly set the OpenAPI version to `3.2.0`, because OpenAPI 3.1 does not support `QUERY`.
159
+
160
+
```ts
161
+
const spec =awaitgenerator.generate(router, {
162
+
base: {
163
+
openapi: '3.2.0',
164
+
},
165
+
})
166
+
```
167
+
156
168
### Json Schema Converters
157
169
158
170
`OpenAPIGenerator` relies on JSON Schema converters to translate your input, output, and error schemas into JSON Schemas. oRPC provides dedicated converters through the [Zod](/docs/integrations/zod), [Valibot](/docs/integrations/valibot), and [ArkType](/docs/integrations/arktype) integrations:
0 commit comments