@trpc/openapi 11.13.2-alpha → 11.13.3-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# OpenAPI schema generation for tRPC
|
|
2
2
|
|
|
3
|
+
The `@trpc/openapi` package generates an OpenAPI 3.1 specification from your tRPC router. Use the spec to:
|
|
4
|
+
|
|
5
|
+
- Generate a typed API client in any language
|
|
6
|
+
- Call tRPC endpoints via HTTP tools like Postman or Insomnia
|
|
7
|
+
- Enable AI agent integrations which can consume OpenAPI
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @trpc/openapi
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
### CLI
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm exec trpc-openapi ./src/server/router.ts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Programmatic
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { generateOpenAPIDocument } from '@trpc/openapi';
|
|
27
|
+
|
|
28
|
+
const doc = generateOpenAPIDocument('./src/server/router.ts', {
|
|
29
|
+
exportName: 'AppRouter',
|
|
30
|
+
title: 'My API',
|
|
31
|
+
version: '1.0.0',
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The generator statically analyses your router's TypeScript types — it never executes your code.
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
Full documentation is available at [trpc.io/docs/openapi](https://trpc.io/docs/openapi).
|
|
40
|
+
|
|
3
41
|
## TODO
|
|
4
42
|
|
|
5
43
|
- [ ] SSE subscriptions
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@trpc/openapi",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "11.13.
|
|
5
|
+
"version": "11.13.3-alpha",
|
|
6
6
|
"description": "OpenAPI document generator for tRPC routers",
|
|
7
7
|
"author": "KATT",
|
|
8
8
|
"license": "MIT",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@hey-api/openapi-ts": "^0.94.1",
|
|
74
74
|
"@swagger-api/apidom-ls": "^1.6.0",
|
|
75
|
-
"@trpc/server": "11.13.
|
|
75
|
+
"@trpc/server": "11.13.3",
|
|
76
76
|
"@types/node": "^22.13.5",
|
|
77
77
|
"bson": "^7.2.0",
|
|
78
78
|
"eslint": "^9.26.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@hey-api/openapi-ts": ">=0.13.0",
|
|
88
|
-
"@trpc/server": "11.13.
|
|
88
|
+
"@trpc/server": "11.13.3",
|
|
89
89
|
"typescript": ">=5.7.2",
|
|
90
90
|
"zod": ">=4.0.0"
|
|
91
91
|
},
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"funding": [
|
|
101
101
|
"https://trpc.io/sponsor"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "985dc7db643885e549b9d68b7e0fe847fcf28a3e"
|
|
104
104
|
}
|