@hono/zod-openapi 0.15.3 → 0.16.1
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 +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -239,8 +239,8 @@ app.openapi(
|
|
|
239
239
|
You can generate OpenAPI v3.1 spec using the following methods:
|
|
240
240
|
|
|
241
241
|
```ts
|
|
242
|
-
app.doc31('/docs', { openapi: '3.1.0' }) // new endpoint
|
|
243
|
-
app.getOpenAPI31Document({ openapi: '3.1.0' }) //
|
|
242
|
+
app.doc31('/docs', { openapi: '3.1.0', info: { title: 'foo', version: '1' } }) // new endpoint
|
|
243
|
+
app.getOpenAPI31Document({ openapi: '3.1.0', info: { title: 'foo', version: '1' } }) // schema object
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
### The Registry
|
package/dist/index.d.mts
CHANGED
|
@@ -69,7 +69,7 @@ type StatusCodeRangeDefinitions = {
|
|
|
69
69
|
type RouteConfigStatusCode = keyof StatusCodeRangeDefinitions | StatusCode;
|
|
70
70
|
type ExtractStatusCode<T extends RouteConfigStatusCode> = T extends keyof StatusCodeRangeDefinitions ? StatusCodeRangeDefinitions[T] : T;
|
|
71
71
|
type RouteConfigToTypedResponse<R extends RouteConfig> = {
|
|
72
|
-
[Status in keyof R['responses'] & RouteConfigStatusCode]: IsJson<keyof R['responses'][Status]['content']> extends never ? TypedResponse<{}, ExtractStatusCode<Status>, string> : TypedResponse<JSONParsed<ExtractContent<R['responses'][Status]['content']>>, ExtractStatusCode<Status>, 'json'>;
|
|
72
|
+
[Status in keyof R['responses'] & RouteConfigStatusCode]: IsJson<keyof R['responses'][Status]['content']> extends never ? TypedResponse<{}, ExtractStatusCode<Status>, string> : TypedResponse<JSONParsed<ExtractContent<R['responses'][Status]['content']>>, ExtractStatusCode<Status>, 'json' | 'text'>;
|
|
73
73
|
}[keyof R['responses'] & RouteConfigStatusCode];
|
|
74
74
|
type Hook<T, E extends Env, P extends string, R> = (result: {
|
|
75
75
|
success: true;
|
package/dist/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ type StatusCodeRangeDefinitions = {
|
|
|
69
69
|
type RouteConfigStatusCode = keyof StatusCodeRangeDefinitions | StatusCode;
|
|
70
70
|
type ExtractStatusCode<T extends RouteConfigStatusCode> = T extends keyof StatusCodeRangeDefinitions ? StatusCodeRangeDefinitions[T] : T;
|
|
71
71
|
type RouteConfigToTypedResponse<R extends RouteConfig> = {
|
|
72
|
-
[Status in keyof R['responses'] & RouteConfigStatusCode]: IsJson<keyof R['responses'][Status]['content']> extends never ? TypedResponse<{}, ExtractStatusCode<Status>, string> : TypedResponse<JSONParsed<ExtractContent<R['responses'][Status]['content']>>, ExtractStatusCode<Status>, 'json'>;
|
|
72
|
+
[Status in keyof R['responses'] & RouteConfigStatusCode]: IsJson<keyof R['responses'][Status]['content']> extends never ? TypedResponse<{}, ExtractStatusCode<Status>, string> : TypedResponse<JSONParsed<ExtractContent<R['responses'][Status]['content']>>, ExtractStatusCode<Status>, 'json' | 'text'>;
|
|
73
73
|
}[keyof R['responses'] & RouteConfigStatusCode];
|
|
74
74
|
type Hook<T, E extends Env, P extends string, R> = (result: {
|
|
75
75
|
success: true;
|