@hono/zod-openapi 1.0.0-beta.1 → 1.0.0
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/CHANGELOG.md +495 -0
- package/dist/index.cjs +8 -4
- package/dist/index.d.cts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.js +8 -4
- package/package.json +10 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
# @hono/zod-openapi
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#1223](https://github.com/honojs/middleware/pull/1223) [`845e336ff41d29fa74ec3cf84afc16f5ac0c2c77`](https://github.com/honojs/middleware/commit/845e336ff41d29fa74ec3cf84afc16f5ac0c2c77) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: support Zod v4
|
|
8
|
+
|
|
9
|
+
Zod OpenAPI has been migrated the Zod version from v3 to v4. As a result, the `zod` in `peerDependencies` has been updated to 4.0.0 or higher.
|
|
10
|
+
|
|
11
|
+
Although this is not a breaking change, it is a major change, so it is considered a major version upgrade.
|
|
12
|
+
|
|
13
|
+
## 0.19.10
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`9f6278f51c846a171a9baa6335fb8fbd9b42cb1c`](https://github.com/honojs/middleware/commit/9f6278f51c846a171a9baa6335fb8fbd9b42cb1c), [`9f6278f51c846a171a9baa6335fb8fbd9b42cb1c`](https://github.com/honojs/middleware/commit/9f6278f51c846a171a9baa6335fb8fbd9b42cb1c)]:
|
|
18
|
+
- @hono/zod-validator@0.7.1
|
|
19
|
+
|
|
20
|
+
## 0.19.9
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#1217](https://github.com/honojs/middleware/pull/1217) [`9f64138406a2c513462f2a4873b2ef8be36df9d8`](https://github.com/honojs/middleware/commit/9f64138406a2c513462f2a4873b2ef8be36df9d8) Thanks [@BarryThePenguin](https://github.com/BarryThePenguin)! - Add explicit return types
|
|
25
|
+
|
|
26
|
+
## 0.19.8
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [[`5c3f61f889f5d96f2ff4a79c9df89c03e25dd7f3`](https://github.com/honojs/middleware/commit/5c3f61f889f5d96f2ff4a79c9df89c03e25dd7f3)]:
|
|
31
|
+
- @hono/zod-validator@0.7.0
|
|
32
|
+
|
|
33
|
+
## 0.19.7
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#1173](https://github.com/honojs/middleware/pull/1173) [`a62b59f4505d10f41523a36ad7c02776f9e1cb01`](https://github.com/honojs/middleware/commit/a62b59f4505d10f41523a36ad7c02776f9e1cb01) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: ignore the type error from Zod Validator
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [[`a62b59f4505d10f41523a36ad7c02776f9e1cb01`](https://github.com/honojs/middleware/commit/a62b59f4505d10f41523a36ad7c02776f9e1cb01)]:
|
|
40
|
+
- @hono/zod-validator@0.6.0
|
|
41
|
+
|
|
42
|
+
## 0.19.6
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [[`8ed99d9d791ed6bd8b897c705289b0464947e632`](https://github.com/honojs/middleware/commit/8ed99d9d791ed6bd8b897c705289b0464947e632)]:
|
|
47
|
+
- @hono/zod-validator@0.5.0
|
|
48
|
+
|
|
49
|
+
## 0.19.5
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- [#1127](https://github.com/honojs/middleware/pull/1127) [`63a9dff2b925a09e8597f327f954f332c3b59b14`](https://github.com/honojs/middleware/commit/63a9dff2b925a09e8597f327f954f332c3b59b14) Thanks [@sigmachirality](https://github.com/sigmachirality)! - chore: lock zod-to-openapi to `^7.3.0` to fix `z.custom`
|
|
54
|
+
|
|
55
|
+
## 0.19.4
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- [#1111](https://github.com/honojs/middleware/pull/1111) [`ad4622a8536c8ef9c5feec2e447f36c2629ecbca`](https://github.com/honojs/middleware/commit/ad4622a8536c8ef9c5feec2e447f36c2629ecbca) Thanks [@BarryThePenguin](https://github.com/BarryThePenguin)! - Republish v0.19.3 without workspace reference
|
|
60
|
+
|
|
61
|
+
## 0.19.3
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- [#1106](https://github.com/honojs/middleware/pull/1106) [`448a8fc687cca2bcab2353ea4237f1293706d5e2`](https://github.com/honojs/middleware/commit/448a8fc687cca2bcab2353ea4237f1293706d5e2) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: infer Env correctly if the middleware is `[]`
|
|
66
|
+
|
|
67
|
+
## 0.19.2
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- [#995](https://github.com/honojs/middleware/pull/995) [`c279ba2bc5204b1b9effc92c45f129904ea67795`](https://github.com/honojs/middleware/commit/c279ba2bc5204b1b9effc92c45f129904ea67795) Thanks [@luxass](https://github.com/luxass)! - fix(zod-openapi): correctly handle path parameters in basePath
|
|
72
|
+
|
|
73
|
+
## 0.19.1
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- [#992](https://github.com/honojs/middleware/pull/992) [`3c738f5ea44f5f5e5cdc14dfeaba5c04188d6373`](https://github.com/honojs/middleware/commit/3c738f5ea44f5f5e5cdc14dfeaba5c04188d6373) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: replace path param strings correctly in basePath
|
|
78
|
+
|
|
79
|
+
## 0.19.0
|
|
80
|
+
|
|
81
|
+
### Minor Changes
|
|
82
|
+
|
|
83
|
+
- [#984](https://github.com/honojs/middleware/pull/984) [`59c6356aac42d360a06cbc9357921283e455ade4`](https://github.com/honojs/middleware/commit/59c6356aac42d360a06cbc9357921283e455ade4) Thanks [@rmichalak](https://github.com/rmichalak)! - Add ability to exclude specific routes from OpenAPI docs
|
|
84
|
+
|
|
85
|
+
## 0.18.4
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- [#955](https://github.com/honojs/middleware/pull/955) [`70a564e268cd6350cfb994e5b5c5626b31a3fcc9`](https://github.com/honojs/middleware/commit/70a564e268cd6350cfb994e5b5c5626b31a3fcc9) Thanks [@luxass](https://github.com/luxass)! - fix: use nested app base paths in openapi schema
|
|
90
|
+
|
|
91
|
+
## 0.18.3
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- [#855](https://github.com/honojs/middleware/pull/855) [`3f63c46fa66bfb7f1d80174bfb160cccfa69f0bc`](https://github.com/honojs/middleware/commit/3f63c46fa66bfb7f1d80174bfb160cccfa69f0bc) Thanks [@jstri](https://github.com/jstri)! - fix: support default response
|
|
96
|
+
|
|
97
|
+
## 0.18.2
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- [#853](https://github.com/honojs/middleware/pull/853) [`a9804afe71fe5876963b3a6f5972a3e5d50dbdca`](https://github.com/honojs/middleware/commit/a9804afe71fe5876963b3a6f5972a3e5d50dbdca) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: return `Response` if response is not text or JSON
|
|
102
|
+
|
|
103
|
+
## 0.18.1
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- [#849](https://github.com/honojs/middleware/pull/849) [`4ebecc61420b6bd94b3a44b8ea58a85654f7ec5d`](https://github.com/honojs/middleware/commit/4ebecc61420b6bd94b3a44b8ea58a85654f7ec5d) Thanks [@askorupskyy](https://github.com/askorupskyy)! - Fix multi-middleware complex object type inference
|
|
108
|
+
|
|
109
|
+
## 0.18.0
|
|
110
|
+
|
|
111
|
+
### Minor Changes
|
|
112
|
+
|
|
113
|
+
- [#837](https://github.com/honojs/middleware/pull/837) [`ebd70a0e03c5bb78ba2d39613e10bdc28fe7822b`](https://github.com/honojs/middleware/commit/ebd70a0e03c5bb78ba2d39613e10bdc28fe7822b) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: support `enum`
|
|
114
|
+
|
|
115
|
+
## 0.17.1
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- [#828](https://github.com/honojs/middleware/pull/828) [`bbb48ef368d8277b89cb938207093462addf4be3`](https://github.com/honojs/middleware/commit/bbb48ef368d8277b89cb938207093462addf4be3) Thanks [@daniel-pedersen](https://github.com/daniel-pedersen)! - infer env type parameter from middleware
|
|
120
|
+
|
|
121
|
+
## 0.17.0
|
|
122
|
+
|
|
123
|
+
### Minor Changes
|
|
124
|
+
|
|
125
|
+
- [#807](https://github.com/honojs/middleware/pull/807) [`2eec6f6fd90b00e130db5f0b3cfeff806132d98a`](https://github.com/honojs/middleware/commit/2eec6f6fd90b00e130db5f0b3cfeff806132d98a) Thanks [@oberbeck](https://github.com/oberbeck)! - introduce routeMiddleware Env inference
|
|
126
|
+
|
|
127
|
+
## 0.16.3
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- [#756](https://github.com/honojs/middleware/pull/756) [`f6d642afddb31ffb379e71398f6fef534a6621f3`](https://github.com/honojs/middleware/commit/f6d642afddb31ffb379e71398f6fef534a6621f3) Thanks [@lucaschultz](https://github.com/lucaschultz)! - fix: add target property to parameter of validation hook
|
|
132
|
+
|
|
133
|
+
## 0.16.2
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- [#750](https://github.com/honojs/middleware/pull/750) [`98d4ceab9c3eef30d14a457844ce94c3da95b9e9`](https://github.com/honojs/middleware/commit/98d4ceab9c3eef30d14a457844ce94c3da95b9e9) Thanks [@yusukebe](https://github.com/yusukebe)! - chore: bump `@hono/zod-validator`
|
|
138
|
+
|
|
139
|
+
## 0.16.1
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [[`eda35847916cf7f7e84289eba29a8e5517615c6b`](https://github.com/honojs/middleware/commit/eda35847916cf7f7e84289eba29a8e5517615c6b)]:
|
|
144
|
+
- @hono/zod-validator@0.3.0
|
|
145
|
+
|
|
146
|
+
## 0.16.0
|
|
147
|
+
|
|
148
|
+
### Minor Changes
|
|
149
|
+
|
|
150
|
+
- [#710](https://github.com/honojs/middleware/pull/710) [`dadf5ce3c2c134b83420702ca8fe13d6fb8d9390`](https://github.com/honojs/middleware/commit/dadf5ce3c2c134b83420702ca8fe13d6fb8d9390) Thanks [@ameinhardt](https://github.com/ameinhardt)! - Allow multiple mime type response
|
|
151
|
+
|
|
152
|
+
## 0.15.3
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- [#689](https://github.com/honojs/middleware/pull/689) [`c3d48868003ebd215074777a4846af208ddab123`](https://github.com/honojs/middleware/commit/c3d48868003ebd215074777a4846af208ddab123) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: supports `required` for JSON and Form body
|
|
157
|
+
|
|
158
|
+
## 0.15.2
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- [#686](https://github.com/honojs/middleware/pull/686) [`a6ec008fbd8235368b796d2c0edb6adfe8c03cc5`](https://github.com/honojs/middleware/commit/a6ec008fbd8235368b796d2c0edb6adfe8c03cc5) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: don't validate the body if content-type is mismatched
|
|
163
|
+
|
|
164
|
+
## 0.15.1
|
|
165
|
+
|
|
166
|
+
### Patch Changes
|
|
167
|
+
|
|
168
|
+
- [#656](https://github.com/honojs/middleware/pull/656) [`a04ab70c2c4254eed24efd81d6e5a31553553ec9`](https://github.com/honojs/middleware/commit/a04ab70c2c4254eed24efd81d6e5a31553553ec9) Thanks [@adjsky](https://github.com/adjsky)! - fix(zod-openapi): infer OpenAPIObjectConfig
|
|
169
|
+
|
|
170
|
+
## 0.15.0
|
|
171
|
+
|
|
172
|
+
### Minor Changes
|
|
173
|
+
|
|
174
|
+
- [#645](https://github.com/honojs/middleware/pull/645) [`f38a6166f6ced37ebea3f7cfcefe91d001b0c3b3`](https://github.com/honojs/middleware/commit/f38a6166f6ced37ebea3f7cfcefe91d001b0c3b3) Thanks [@DavidHavl](https://github.com/DavidHavl)! - Support other json content-types such as application/vnd.api+json, application/problem+json, etc.
|
|
175
|
+
|
|
176
|
+
## 0.14.9
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- [#632](https://github.com/honojs/middleware/pull/632) [`a405d0870998f131dbc05a44fae0e6df7ff82521`](https://github.com/honojs/middleware/commit/a405d0870998f131dbc05a44fae0e6df7ff82521) Thanks [@paolostyle](https://github.com/paolostyle)! - expose `extendZodWithOpenApi` from `zod-to-openapi`
|
|
181
|
+
|
|
182
|
+
## 0.14.8
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- [#623](https://github.com/honojs/middleware/pull/623) [`834a97a7b069fe5301f305f18bf271f3842af647`](https://github.com/honojs/middleware/commit/834a97a7b069fe5301f305f18bf271f3842af647) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: support `coerce`
|
|
187
|
+
|
|
188
|
+
## 0.14.7
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- [#609](https://github.com/honojs/middleware/pull/609) [`b06bde6ef59368e00c7c75f5866687df2ce47bd9`](https://github.com/honojs/middleware/commit/b06bde6ef59368e00c7c75f5866687df2ce47bd9) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: support a base path
|
|
193
|
+
|
|
194
|
+
## 0.14.6
|
|
195
|
+
|
|
196
|
+
### Patch Changes
|
|
197
|
+
|
|
198
|
+
- [#607](https://github.com/honojs/middleware/pull/607) [`375c98b145560c855f9000c523734bb2d31990c9`](https://github.com/honojs/middleware/commit/375c98b145560c855f9000c523734bb2d31990c9) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: remove the type error for the hook
|
|
199
|
+
|
|
200
|
+
## 0.14.5
|
|
201
|
+
|
|
202
|
+
### Patch Changes
|
|
203
|
+
|
|
204
|
+
- [#582](https://github.com/honojs/middleware/pull/582) [`053a85c722833b1f670fe667fb80b3cbe88f9a4d`](https://github.com/honojs/middleware/commit/053a85c722833b1f670fe667fb80b3cbe88f9a4d) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: bump `@asteasolutions/zod-to-openapi`
|
|
205
|
+
|
|
206
|
+
## 0.14.4
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- [#576](https://github.com/honojs/middleware/pull/576) [`9a9de504942358be5a77236231e20f5016b6d1a9`](https://github.com/honojs/middleware/commit/9a9de504942358be5a77236231e20f5016b6d1a9) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: use `JSONParsed` for creating a response type
|
|
211
|
+
|
|
212
|
+
## 0.14.3
|
|
213
|
+
|
|
214
|
+
### Patch Changes
|
|
215
|
+
|
|
216
|
+
- [#574](https://github.com/honojs/middleware/pull/574) [`ef9f45ab692c81e1474cfb054f55a2c9fc39bdf8`](https://github.com/honojs/middleware/commit/ef9f45ab692c81e1474cfb054f55a2c9fc39bdf8) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: relax types to support `.refine()` for an object
|
|
217
|
+
|
|
218
|
+
## 0.14.2
|
|
219
|
+
|
|
220
|
+
### Patch Changes
|
|
221
|
+
|
|
222
|
+
- [#557](https://github.com/honojs/middleware/pull/557) [`69e53644647c156e5f6df0d981eabcd490c4e60b`](https://github.com/honojs/middleware/commit/69e53644647c156e5f6df0d981eabcd490c4e60b) Thanks [@arjunyel](https://github.com/arjunyel)! - Fix OpenAPI yaml with route middleware
|
|
223
|
+
|
|
224
|
+
## 0.14.1
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- Updated dependencies [[`aa055494974eb911ec784e6462691aafefd98125`](https://github.com/honojs/middleware/commit/aa055494974eb911ec784e6462691aafefd98125)]:
|
|
229
|
+
- @hono/zod-validator@0.2.2
|
|
230
|
+
|
|
231
|
+
## 0.14.0
|
|
232
|
+
|
|
233
|
+
### Minor Changes
|
|
234
|
+
|
|
235
|
+
- [#535](https://github.com/honojs/middleware/pull/535) [`a595e4e260040decd871e271c60c5a07c6db4086`](https://github.com/honojs/middleware/commit/a595e4e260040decd871e271c60c5a07c6db4086) Thanks [@taku-hatano](https://github.com/taku-hatano)! - extract range definitions to StatusCode
|
|
236
|
+
|
|
237
|
+
## 0.13.0
|
|
238
|
+
|
|
239
|
+
### Minor Changes
|
|
240
|
+
|
|
241
|
+
- [#532](https://github.com/honojs/middleware/pull/532) [`eeccd4fc2fd63c9d79d7a4911f80fa94d1680983`](https://github.com/honojs/middleware/commit/eeccd4fc2fd63c9d79d7a4911f80fa94d1680983) Thanks [@akineko](https://github.com/akineko)! - feat(zod-openapi): export RouteConfig type
|
|
242
|
+
|
|
243
|
+
## 0.12.2
|
|
244
|
+
|
|
245
|
+
### Patch Changes
|
|
246
|
+
|
|
247
|
+
- [#529](https://github.com/honojs/middleware/pull/529) [`0a43d2c562f5adb12009f6bdd0e7fb7c06a625e6`](https://github.com/honojs/middleware/commit/0a43d2c562f5adb12009f6bdd0e7fb7c06a625e6) Thanks [@akineko](https://github.com/akineko)! - fix(zod-openapi): update RouteHandler type to support MaybePromise
|
|
248
|
+
|
|
249
|
+
## 0.12.1
|
|
250
|
+
|
|
251
|
+
### Patch Changes
|
|
252
|
+
|
|
253
|
+
- [#522](https://github.com/honojs/middleware/pull/522) [`2d5ef8255861482cd62deee3d6616a2e21016d53`](https://github.com/honojs/middleware/commit/2d5ef8255861482cd62deee3d6616a2e21016d53) Thanks [@alexzhang1030](https://github.com/alexzhang1030)! - fix(zod-openapi): return type of handler should be MaybePromise
|
|
254
|
+
|
|
255
|
+
## 0.12.0
|
|
256
|
+
|
|
257
|
+
### Minor Changes
|
|
258
|
+
|
|
259
|
+
- [#519](https://github.com/honojs/middleware/pull/519) [`b03484ba056215f0506894f9156cb1e2963cb450`](https://github.com/honojs/middleware/commit/b03484ba056215f0506894f9156cb1e2963cb450) Thanks [@yusukebe](https://github.com/yusukebe)! - feat(zod-openapi): support "status code"
|
|
260
|
+
|
|
261
|
+
## 0.11.1
|
|
262
|
+
|
|
263
|
+
### Patch Changes
|
|
264
|
+
|
|
265
|
+
- [#510](https://github.com/honojs/middleware/pull/510) [`88113fae8b5bd5d0a7662a1cca426f522da109b7`](https://github.com/honojs/middleware/commit/88113fae8b5bd5d0a7662a1cca426f522da109b7) Thanks [@taku-hatano](https://github.com/taku-hatano)! - Add Promise<void> to Hook
|
|
266
|
+
|
|
267
|
+
## 0.11.0
|
|
268
|
+
|
|
269
|
+
### Minor Changes
|
|
270
|
+
|
|
271
|
+
- [#435](https://github.com/honojs/middleware/pull/435) [`4660092b9ae446e3a6da32628e1bead361769e8a`](https://github.com/honojs/middleware/commit/4660092b9ae446e3a6da32628e1bead361769e8a) Thanks [@RomanNabukhotnyi](https://github.com/RomanNabukhotnyi)! - Add 'middleware' property for route
|
|
272
|
+
|
|
273
|
+
## 0.10.1
|
|
274
|
+
|
|
275
|
+
### Patch Changes
|
|
276
|
+
|
|
277
|
+
- [#445](https://github.com/honojs/middleware/pull/445) [`110e27246015cac60c8a07cd078c3245b7ddbeeb`](https://github.com/honojs/middleware/commit/110e27246015cac60c8a07cd078c3245b7ddbeeb) Thanks [@fumieval](https://github.com/fumieval)! - Make getRoutingPath property of a RouteConfig non-enumerable
|
|
278
|
+
|
|
279
|
+
## 0.10.0
|
|
280
|
+
|
|
281
|
+
### Minor Changes
|
|
282
|
+
|
|
283
|
+
- [#443](https://github.com/honojs/middleware/pull/443) [`1e0d857ef9f756d1217eaccf37a028be7a107d78`](https://github.com/honojs/middleware/commit/1e0d857ef9f756d1217eaccf37a028be7a107d78) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: bump `zod-to-openapi` supports ESM
|
|
284
|
+
|
|
285
|
+
## 0.9.10
|
|
286
|
+
|
|
287
|
+
### Patch Changes
|
|
288
|
+
|
|
289
|
+
- [#437](https://github.com/honojs/middleware/pull/437) [`9fc8591960ca547cb26a8d32d8f1e2c2f3568b95`](https://github.com/honojs/middleware/commit/9fc8591960ca547cb26a8d32d8f1e2c2f3568b95) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: bump `@hono/zod-validator`
|
|
290
|
+
|
|
291
|
+
## 0.9.9
|
|
292
|
+
|
|
293
|
+
### Patch Changes
|
|
294
|
+
|
|
295
|
+
- [#429](https://github.com/honojs/middleware/pull/429) [`b1f8a5325c3ad5eaa029ca5a82e7ef7adc7e6660`](https://github.com/honojs/middleware/commit/b1f8a5325c3ad5eaa029ca5a82e7ef7adc7e6660) Thanks [@hmnd](https://github.com/hmnd)! - fix: base path not included in client types
|
|
296
|
+
|
|
297
|
+
## 0.9.8
|
|
298
|
+
|
|
299
|
+
### Patch Changes
|
|
300
|
+
|
|
301
|
+
- Updated dependencies [[`4875e1c53146d2c67846b8159d3630d465c2a310`](https://github.com/honojs/middleware/commit/4875e1c53146d2c67846b8159d3630d465c2a310)]:
|
|
302
|
+
- @hono/zod-validator@0.2.0
|
|
303
|
+
|
|
304
|
+
## 0.9.7
|
|
305
|
+
|
|
306
|
+
### Patch Changes
|
|
307
|
+
|
|
308
|
+
- [#408](https://github.com/honojs/middleware/pull/408) [`d4ca1ce98f33ae67100986613144e9d12fb933b3`](https://github.com/honojs/middleware/commit/d4ca1ce98f33ae67100986613144e9d12fb933b3) Thanks [@DavidHavl](https://github.com/DavidHavl)! - fix: Fix basePath method disregarding defaultHook
|
|
309
|
+
|
|
310
|
+
## 0.9.6
|
|
311
|
+
|
|
312
|
+
### Patch Changes
|
|
313
|
+
|
|
314
|
+
- [#356](https://github.com/honojs/middleware/pull/356) [`168a0a6d684a0750ab95802d6316e562061f786c`](https://github.com/honojs/middleware/commit/168a0a6d684a0750ab95802d6316e562061f786c) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: handle `Conflicting names for parameter`
|
|
315
|
+
|
|
316
|
+
## 0.9.5
|
|
317
|
+
|
|
318
|
+
### Patch Changes
|
|
319
|
+
|
|
320
|
+
- [#316](https://github.com/honojs/middleware/pull/316) [`5eeb555`](https://github.com/honojs/middleware/commit/5eeb555c8958fb890e80262e3dbf532f3c8c1e55) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: supports named params in nested routes
|
|
321
|
+
|
|
322
|
+
## 0.9.4
|
|
323
|
+
|
|
324
|
+
### Patch Changes
|
|
325
|
+
|
|
326
|
+
- [#313](https://github.com/honojs/middleware/pull/313) [`b8219d9`](https://github.com/honojs/middleware/commit/b8219d9b68e6aba7466705d0787dbdd15b808b06) Thanks [@WildEgo](https://github.com/WildEgo)! - change: Export Hook in @hono/zod-openapi
|
|
327
|
+
|
|
328
|
+
## 0.9.3
|
|
329
|
+
|
|
330
|
+
### Patch Changes
|
|
331
|
+
|
|
332
|
+
- [#292](https://github.com/honojs/middleware/pull/292) [`7ded22a`](https://github.com/honojs/middleware/commit/7ded22a57edba4d30144fd7641d9502eecefc1ac) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: bump Hono for peerDependencies and add tests
|
|
333
|
+
|
|
334
|
+
## 0.9.2
|
|
335
|
+
|
|
336
|
+
### Patch Changes
|
|
337
|
+
|
|
338
|
+
- [#286](https://github.com/honojs/middleware/pull/286) [`8178ba0`](https://github.com/honojs/middleware/commit/8178ba094f9bcc289b57f017a79fb075b08566cb) Thanks [@fahchen](https://github.com/fahchen)! - use z.input to infer input types of the request
|
|
339
|
+
|
|
340
|
+
## 0.9.1
|
|
341
|
+
|
|
342
|
+
### Patch Changes
|
|
343
|
+
|
|
344
|
+
- [#287](https://github.com/honojs/middleware/pull/287) [`1568b92`](https://github.com/honojs/middleware/commit/1568b920de1e45b963d1812c32932fad01dbe2fe) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: Strict type checking of return values
|
|
345
|
+
|
|
346
|
+
## 0.9.0
|
|
347
|
+
|
|
348
|
+
### Minor Changes
|
|
349
|
+
|
|
350
|
+
- [#272](https://github.com/honojs/middleware/pull/272) [`d4aa8ec`](https://github.com/honojs/middleware/commit/d4aa8ec5ad38942c1606642dc4676a92a7c006a8) Thanks [@Karibash](https://github.com/Karibash)! - Make context accessible in the doc route
|
|
351
|
+
|
|
352
|
+
## 0.8.6
|
|
353
|
+
|
|
354
|
+
### Patch Changes
|
|
355
|
+
|
|
356
|
+
- [#260](https://github.com/honojs/middleware/pull/260) [`ba83a26`](https://github.com/honojs/middleware/commit/ba83a268e010a7b18172e7de01e3901b58a7ec62) Thanks [@Karibash](https://github.com/Karibash)! - Make it possible to do method chaining even for doc methods
|
|
357
|
+
|
|
358
|
+
## 0.8.5
|
|
359
|
+
|
|
360
|
+
### Patch Changes
|
|
361
|
+
|
|
362
|
+
- [#258](https://github.com/honojs/middleware/pull/258) [`368c352`](https://github.com/honojs/middleware/commit/368c3520fa8a15657e8e42313bbfde3d87b0183b) Thanks [@Karibash](https://github.com/Karibash)! - Fix a bug that slashes were duplicated when mounting a path using the route method
|
|
363
|
+
|
|
364
|
+
## 0.8.4
|
|
365
|
+
|
|
366
|
+
### Patch Changes
|
|
367
|
+
|
|
368
|
+
- [#255](https://github.com/honojs/middleware/pull/255) [`129f468`](https://github.com/honojs/middleware/commit/129f4680a2c050ec49a0422d735e0d173d7b5faf) Thanks [@Karibash](https://github.com/Karibash)! - Fix incorrect specification of the exports field in package.json
|
|
369
|
+
|
|
370
|
+
## 0.8.3
|
|
371
|
+
|
|
372
|
+
### Patch Changes
|
|
373
|
+
|
|
374
|
+
- [#222](https://github.com/honojs/middleware/pull/222) [`73ab82a`](https://github.com/honojs/middleware/commit/73ab82a90253a0dbc536251787ff5713981a4075) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: import types correctly
|
|
375
|
+
|
|
376
|
+
## 0.8.2
|
|
377
|
+
|
|
378
|
+
### Patch Changes
|
|
379
|
+
|
|
380
|
+
- [#217](https://github.com/honojs/middleware/pull/217) [`a80c84b`](https://github.com/honojs/middleware/commit/a80c84ba07153f8521c1fc0286abef0623c99b5c) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: bump Hono for `peerDependencies`
|
|
381
|
+
|
|
382
|
+
## 0.8.1
|
|
383
|
+
|
|
384
|
+
### Patch Changes
|
|
385
|
+
|
|
386
|
+
- [#211](https://github.com/honojs/middleware/pull/211) [`6ca8e8d`](https://github.com/honojs/middleware/commit/6ca8e8d8de85dde7b9c25bfd5665aa32e233402e) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: relax input types
|
|
387
|
+
|
|
388
|
+
## 0.8.0
|
|
389
|
+
|
|
390
|
+
### Minor Changes
|
|
391
|
+
|
|
392
|
+
- [#206](https://github.com/honojs/middleware/pull/206) [`2d2fdd0`](https://github.com/honojs/middleware/commit/2d2fdd0379a31320b06f6d1a9e4634bfe1b7c657) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: allows the response to be `Response` not just `TypedResponse`.
|
|
393
|
+
|
|
394
|
+
## 0.7.2
|
|
395
|
+
|
|
396
|
+
### Patch Changes
|
|
397
|
+
|
|
398
|
+
- [#189](https://github.com/honojs/middleware/pull/189) [`58167f3`](https://github.com/honojs/middleware/commit/58167f3b7f3c564334f5182529f0ddb29ace0af1) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: publish as cjs by default
|
|
399
|
+
|
|
400
|
+
## 0.7.1
|
|
401
|
+
|
|
402
|
+
### Patch Changes
|
|
403
|
+
|
|
404
|
+
- [#182](https://github.com/honojs/middleware/pull/182) [`9aefddc`](https://github.com/honojs/middleware/commit/9aefddc45d048e5e51eb36d81cb878c62a72ba9f) Thanks [@ZerNico](https://github.com/ZerNico)! - properly convert openapi path type to hono
|
|
405
|
+
|
|
406
|
+
## 0.7.0
|
|
407
|
+
|
|
408
|
+
### Minor Changes
|
|
409
|
+
|
|
410
|
+
- [#170](https://github.com/honojs/middleware/pull/170) [`9c45dbc`](https://github.com/honojs/middleware/commit/9c45dbc41d46ae4d04d9351757020d7ad528b400) Thanks [@msutkowski](https://github.com/msutkowski)! - Add defaultHook as an option for OpenAPIHono
|
|
411
|
+
|
|
412
|
+
### Patch Changes
|
|
413
|
+
|
|
414
|
+
- [#179](https://github.com/honojs/middleware/pull/179) [`047eca5`](https://github.com/honojs/middleware/commit/047eca5ca99085ee8c4f1581b17c8ebeae6afc82) Thanks [@yusukebe](https://github.com/yusukebe)! - fix(zod-openapi): enable `basePath()`
|
|
415
|
+
|
|
416
|
+
- [#176](https://github.com/honojs/middleware/pull/176) [`fb63ef4`](https://github.com/honojs/middleware/commit/fb63ef413cb7b843aebe756a5322bdd10ba74500) Thanks [@yusukebe](https://github.com/yusukebe)! - fix(zod-openapi): make multiple routes types correct for `hc`
|
|
417
|
+
|
|
418
|
+
- Updated dependencies [[`a9123dd`](https://github.com/honojs/middleware/commit/a9123dd9e3e90d4d73f495d6b407ebacf9ea0ad8)]:
|
|
419
|
+
- @hono/zod-validator@0.1.9
|
|
420
|
+
|
|
421
|
+
## 0.6.0
|
|
422
|
+
|
|
423
|
+
### Minor Changes
|
|
424
|
+
|
|
425
|
+
- [#167](https://github.com/honojs/middleware/pull/167) [`dbebf74`](https://github.com/honojs/middleware/commit/dbebf747c9c7ca94bf22259772d8b1e0623ce68d) Thanks [@exsjabe](https://github.com/exsjabe)! - Export types that allow for separate declaratins of route handlers and hooks
|
|
426
|
+
|
|
427
|
+
## 0.5.1
|
|
428
|
+
|
|
429
|
+
### Patch Changes
|
|
430
|
+
|
|
431
|
+
- [#164](https://github.com/honojs/middleware/pull/164) [`62a97fd`](https://github.com/honojs/middleware/commit/62a97fda6a784f11549fff442978677642d2b218) Thanks [@yusukebe](https://github.com/yusukebe)! - fix(zod-openapi): use `z.output` for types after validation
|
|
432
|
+
|
|
433
|
+
## 0.5.0
|
|
434
|
+
|
|
435
|
+
### Minor Changes
|
|
436
|
+
|
|
437
|
+
- [#161](https://github.com/honojs/middleware/pull/161) [`05b8e9a`](https://github.com/honojs/middleware/commit/05b8e9a7511874f7e9dcb84b9dcfa97ca458ae4e) Thanks [@naporin0624](https://github.com/naporin0624)! - Add getRoutingPath to the return value of createRoute.
|
|
438
|
+
|
|
439
|
+
## 0.4.0
|
|
440
|
+
|
|
441
|
+
### Minor Changes
|
|
442
|
+
|
|
443
|
+
- [#153](https://github.com/honojs/middleware/pull/153) [`430088e`](https://github.com/honojs/middleware/commit/430088e17569a12e354c80c1d6da67a9ecbfdffe) Thanks [@mikestopcontinues](https://github.com/mikestopcontinues)! - Merge subapps' spec definitions into main app
|
|
444
|
+
|
|
445
|
+
- [#153](https://github.com/honojs/middleware/pull/153) [`430088e`](https://github.com/honojs/middleware/commit/430088e17569a12e354c80c1d6da67a9ecbfdffe) Thanks [@mikestopcontinues](https://github.com/mikestopcontinues)! - Support v3.1 spec output
|
|
446
|
+
|
|
447
|
+
- [#153](https://github.com/honojs/middleware/pull/153) [`430088e`](https://github.com/honojs/middleware/commit/430088e17569a12e354c80c1d6da67a9ecbfdffe) Thanks [@mikestopcontinues](https://github.com/mikestopcontinues)! - OpenAPIHono constructor supports init object
|
|
448
|
+
|
|
449
|
+
## 0.3.1
|
|
450
|
+
|
|
451
|
+
### Patch Changes
|
|
452
|
+
|
|
453
|
+
- [#155](https://github.com/honojs/middleware/pull/155) [`804caac`](https://github.com/honojs/middleware/commit/804caac19123e0b6d9a3f33b686051f1f111ee1f) Thanks [@yusukebe](https://github.com/yusukebe)! - fix(zod-openapi): support multiple params
|
|
454
|
+
|
|
455
|
+
## 0.3.0
|
|
456
|
+
|
|
457
|
+
### Minor Changes
|
|
458
|
+
|
|
459
|
+
- [#150](https://github.com/honojs/middleware/pull/150) [`1006cbc`](https://github.com/honojs/middleware/commit/1006cbca6b6636340afe10f7680511bab2046b47) Thanks [@yusukebe](https://github.com/yusukebe)! - feat(zod-openapi): make `app.openAPIRegistry` public
|
|
460
|
+
|
|
461
|
+
### Patch Changes
|
|
462
|
+
|
|
463
|
+
- [#148](https://github.com/honojs/middleware/pull/148) [`1bfd648`](https://github.com/honojs/middleware/commit/1bfd648df8dfcd659c14514b977de945d3806b7d) Thanks [@yusukebe](https://github.com/yusukebe)! - fix(zod-openapi): fix a type error
|
|
464
|
+
|
|
465
|
+
## 0.2.0
|
|
466
|
+
|
|
467
|
+
### Minor Changes
|
|
468
|
+
|
|
469
|
+
- [#141](https://github.com/honojs/middleware/pull/141) [`f334e99`](https://github.com/honojs/middleware/commit/f334e99251cdabc8be9334eec7eb7d9a450d8e35) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: support `headers` and `cookies`
|
|
470
|
+
|
|
471
|
+
## 0.1.2
|
|
472
|
+
|
|
473
|
+
### Patch Changes
|
|
474
|
+
|
|
475
|
+
- [#139](https://github.com/honojs/middleware/pull/139) [`991b859`](https://github.com/honojs/middleware/commit/991b85915a63d1fd15cda52078f6401c17d3879f) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: bump up Hono version
|
|
476
|
+
|
|
477
|
+
## 0.1.1
|
|
478
|
+
|
|
479
|
+
### Patch Changes
|
|
480
|
+
|
|
481
|
+
- [#132](https://github.com/honojs/middleware/pull/132) [`2dbc823`](https://github.com/honojs/middleware/commit/2dbc823b29a95e6c81bedc5416c08f15ac97288d) Thanks [@yusukebe](https://github.com/yusukebe)! - fix path param format `:id` to `{id}`
|
|
482
|
+
|
|
483
|
+
## 0.1.0
|
|
484
|
+
|
|
485
|
+
### Minor Changes
|
|
486
|
+
|
|
487
|
+
- [#124](https://github.com/honojs/middleware/pull/124) [`e6b20c6`](https://github.com/honojs/middleware/commit/e6b20c64b61654dc742b233ad09d764c71db7186) Thanks [@yusukebe](https://github.com/yusukebe)! - feat(zod-openapi): support RPC-mode
|
|
488
|
+
|
|
489
|
+
## 0.0.1
|
|
490
|
+
|
|
491
|
+
### Patch Changes
|
|
492
|
+
|
|
493
|
+
- [#121](https://github.com/honojs/middleware/pull/121) [`1233c00`](https://github.com/honojs/middleware/commit/1233c00875827749599880ade5830f8a1e7d73e8) Thanks [@yusukebe](https://github.com/yusukebe)! - docs: fixed readme
|
|
494
|
+
|
|
495
|
+
- [#118](https://github.com/honojs/middleware/pull/118) [`7b89803`](https://github.com/honojs/middleware/commit/7b898034a50c9bfa08872e28dcaa066ea55d9e3d) Thanks [@yusukebe](https://github.com/yusukebe)! - introduce Zod OpenAPI
|
package/dist/index.cjs
CHANGED
|
@@ -189,8 +189,8 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
189
189
|
switch (def.type) {
|
|
190
190
|
case "component":
|
|
191
191
|
return this.openAPIRegistry.registerComponent(def.componentType, def.name, def.component);
|
|
192
|
-
case "route":
|
|
193
|
-
|
|
192
|
+
case "route": {
|
|
193
|
+
this.openAPIRegistry.registerPath({
|
|
194
194
|
...def.route,
|
|
195
195
|
path: (0, import_url.mergePath)(
|
|
196
196
|
pathForOpenAPI,
|
|
@@ -199,8 +199,10 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
199
199
|
def.route.path
|
|
200
200
|
)
|
|
201
201
|
});
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
case "webhook": {
|
|
205
|
+
this.openAPIRegistry.registerWebhook({
|
|
204
206
|
...def.webhook,
|
|
205
207
|
path: (0, import_url.mergePath)(
|
|
206
208
|
pathForOpenAPI,
|
|
@@ -209,6 +211,8 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
209
211
|
def.webhook.path
|
|
210
212
|
)
|
|
211
213
|
});
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
212
216
|
case "schema":
|
|
213
217
|
return this.openAPIRegistry.register(
|
|
214
218
|
(0, import_zod_to_openapi.getOpenApiMetadata)(def.schema)._internal?.refId,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import * as _asteasolutions_zod_to_openapi_dist_v3_1_openapi_generator from '@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator';
|
|
3
|
-
import * as openapi3_ts_oas30 from 'openapi3-ts/oas30';
|
|
4
|
-
import * as _asteasolutions_zod_to_openapi_dist_v3_0_openapi_generator from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator';
|
|
5
1
|
import { RouteConfig as RouteConfig$1, ZodRequestBody, ZodContentObject, ZodMediaTypeObject, OpenApiGeneratorV3, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
|
|
6
2
|
export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
7
3
|
import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
|
|
8
4
|
import { MergePath, MergeSchemaPath } from 'hono/types';
|
|
9
5
|
import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
|
|
10
6
|
import { SimplifyDeepArray, JSONValue, JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
|
|
7
|
+
import { OpenAPIObject } from 'openapi3-ts/oas30';
|
|
8
|
+
import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
|
|
11
9
|
import { ZodType, z, ZodError } from 'zod/v4';
|
|
12
10
|
export { z } from 'zod/v4';
|
|
13
11
|
|
|
@@ -193,8 +191,8 @@ declare class OpenAPIHono<E extends Env = Env, S extends Schema = {}, BasePath e
|
|
|
193
191
|
};
|
|
194
192
|
};
|
|
195
193
|
} ? MaybePromise<RouteConfigToTypedResponse<R>> | undefined : MaybePromise<RouteConfigToTypedResponse<R>> | MaybePromise<Response> | undefined> | undefined) => OpenAPIHono<E, S & ToSchema<R["method"], MergePath<BasePath, P>, I, RouteConfigToTypedResponse<R>>, BasePath>;
|
|
196
|
-
getOpenAPIDocument: (config: OpenAPIObjectConfig) =>
|
|
197
|
-
getOpenAPI31Document: (config: OpenAPIObjectConfig) =>
|
|
194
|
+
getOpenAPIDocument: (config: OpenAPIObjectConfig) => OpenAPIObject;
|
|
195
|
+
getOpenAPI31Document: (config: OpenAPIObjectConfig) => OpenAPIObject$1;
|
|
198
196
|
doc: <P extends string>(path: P, configure: OpenAPIObjectConfigure<E, P>) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
|
|
199
197
|
doc31: <P extends string>(path: P, configure: OpenAPIObjectConfigure<E, P>) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
|
|
200
198
|
route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): OpenAPIHono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import * as _asteasolutions_zod_to_openapi_dist_v3_1_openapi_generator from '@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator';
|
|
3
|
-
import * as openapi3_ts_oas30 from 'openapi3-ts/oas30';
|
|
4
|
-
import * as _asteasolutions_zod_to_openapi_dist_v3_0_openapi_generator from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator';
|
|
5
1
|
import { RouteConfig as RouteConfig$1, ZodRequestBody, ZodContentObject, ZodMediaTypeObject, OpenApiGeneratorV3, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
|
|
6
2
|
export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
7
3
|
import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
|
|
8
4
|
import { MergePath, MergeSchemaPath } from 'hono/types';
|
|
9
5
|
import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
|
|
10
6
|
import { SimplifyDeepArray, JSONValue, JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
|
|
7
|
+
import { OpenAPIObject } from 'openapi3-ts/oas30';
|
|
8
|
+
import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
|
|
11
9
|
import { ZodType, z, ZodError } from 'zod/v4';
|
|
12
10
|
export { z } from 'zod/v4';
|
|
13
11
|
|
|
@@ -193,8 +191,8 @@ declare class OpenAPIHono<E extends Env = Env, S extends Schema = {}, BasePath e
|
|
|
193
191
|
};
|
|
194
192
|
};
|
|
195
193
|
} ? MaybePromise<RouteConfigToTypedResponse<R>> | undefined : MaybePromise<RouteConfigToTypedResponse<R>> | MaybePromise<Response> | undefined> | undefined) => OpenAPIHono<E, S & ToSchema<R["method"], MergePath<BasePath, P>, I, RouteConfigToTypedResponse<R>>, BasePath>;
|
|
196
|
-
getOpenAPIDocument: (config: OpenAPIObjectConfig) =>
|
|
197
|
-
getOpenAPI31Document: (config: OpenAPIObjectConfig) =>
|
|
194
|
+
getOpenAPIDocument: (config: OpenAPIObjectConfig) => OpenAPIObject;
|
|
195
|
+
getOpenAPI31Document: (config: OpenAPIObjectConfig) => OpenAPIObject$1;
|
|
198
196
|
doc: <P extends string>(path: P, configure: OpenAPIObjectConfigure<E, P>) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
|
|
199
197
|
doc31: <P extends string>(path: P, configure: OpenAPIObjectConfigure<E, P>) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
|
|
200
198
|
route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): OpenAPIHono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>;
|
package/dist/index.js
CHANGED
|
@@ -168,8 +168,8 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
168
168
|
switch (def.type) {
|
|
169
169
|
case "component":
|
|
170
170
|
return this.openAPIRegistry.registerComponent(def.componentType, def.name, def.component);
|
|
171
|
-
case "route":
|
|
172
|
-
|
|
171
|
+
case "route": {
|
|
172
|
+
this.openAPIRegistry.registerPath({
|
|
173
173
|
...def.route,
|
|
174
174
|
path: mergePath(
|
|
175
175
|
pathForOpenAPI,
|
|
@@ -178,8 +178,10 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
178
178
|
def.route.path
|
|
179
179
|
)
|
|
180
180
|
});
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
case "webhook": {
|
|
184
|
+
this.openAPIRegistry.registerWebhook({
|
|
183
185
|
...def.webhook,
|
|
184
186
|
path: mergePath(
|
|
185
187
|
pathForOpenAPI,
|
|
@@ -188,6 +190,8 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
188
190
|
def.webhook.path
|
|
189
191
|
)
|
|
190
192
|
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
191
195
|
case "schema":
|
|
192
196
|
return this.openAPIRegistry.register(
|
|
193
197
|
getOpenApiMetadata(def.schema)._internal?.refId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hono/zod-openapi",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A wrapper class of Hono which supports OpenAPI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"prepack": "yarn build",
|
|
14
14
|
"publint": "attw --pack && publint",
|
|
15
15
|
"typecheck": "tsc -b tsconfig.json",
|
|
16
|
-
"test": "vitest"
|
|
16
|
+
"test": "vitest",
|
|
17
|
+
"version:jsr": "yarn version:set $npm_package_version"
|
|
17
18
|
},
|
|
18
19
|
"exports": {
|
|
19
20
|
".": {
|
|
@@ -40,20 +41,22 @@
|
|
|
40
41
|
"homepage": "https://github.com/honojs/middleware",
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"hono": ">=4.3.6",
|
|
43
|
-
"zod": "^
|
|
44
|
+
"zod": "^4.0.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
48
|
+
"hono": "^4.8.4",
|
|
47
49
|
"publint": "^0.3.9",
|
|
48
50
|
"tsup": "^8.4.0",
|
|
49
51
|
"typescript": "^5.8.2",
|
|
50
|
-
"vitest": "^3.
|
|
52
|
+
"vitest": "^3.2.4",
|
|
51
53
|
"yaml": "^2.4.3",
|
|
52
|
-
"zod": "^
|
|
54
|
+
"zod": "^4.0.5"
|
|
53
55
|
},
|
|
54
56
|
"dependencies": {
|
|
55
|
-
"@asteasolutions/zod-to-openapi": "^8.0.0
|
|
56
|
-
"@hono/zod-validator": "^0.7.
|
|
57
|
+
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
58
|
+
"@hono/zod-validator": "^0.7.1",
|
|
59
|
+
"openapi3-ts": "^4.5.0"
|
|
57
60
|
},
|
|
58
61
|
"engines": {
|
|
59
62
|
"node": ">=16.0.0"
|