fix(zod-openapi): infer OpenAPIObjectConfig (#656)
* fix(zod-openapi): infer OpenAPIObjectConfig * minor -> patchpull/659/head
parent
795d4af3d4
commit
a04ab70c2c
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/zod-openapi': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(zod-openapi): infer OpenAPIObjectConfig
|
|
@ -12,7 +12,6 @@ import {
|
||||||
OpenApiGeneratorV31,
|
OpenApiGeneratorV31,
|
||||||
extendZodWithOpenApi,
|
extendZodWithOpenApi,
|
||||||
} from '@asteasolutions/zod-to-openapi'
|
} from '@asteasolutions/zod-to-openapi'
|
||||||
import type { OpenAPIObjectConfig } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator'
|
|
||||||
import { zValidator } from '@hono/zod-validator'
|
import { zValidator } from '@hono/zod-validator'
|
||||||
import { Hono } from 'hono'
|
import { Hono } from 'hono'
|
||||||
import type {
|
import type {
|
||||||
|
@ -252,6 +251,10 @@ export type RouteHook<
|
||||||
RouteConfigToTypedResponse<R> | Response | Promise<Response> | void | Promise<void>
|
RouteConfigToTypedResponse<R> | Response | Promise<Response> | void | Promise<void>
|
||||||
>
|
>
|
||||||
|
|
||||||
|
type OpenAPIObjectConfig = Parameters<
|
||||||
|
InstanceType<typeof OpenApiGeneratorV3>['generateDocument']
|
||||||
|
>[0]
|
||||||
|
|
||||||
export type OpenAPIObjectConfigure<E extends Env, P extends string> =
|
export type OpenAPIObjectConfigure<E extends Env, P extends string> =
|
||||||
| OpenAPIObjectConfig
|
| OpenAPIObjectConfig
|
||||||
| ((context: Context<E, P>) => OpenAPIObjectConfig)
|
| ((context: Context<E, P>) => OpenAPIObjectConfig)
|
||||||
|
|
Loading…
Reference in New Issue