@hono/zod-openapi
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -26,3 +26,3 @@ import * as openapi3_ts_oas31 from 'openapi3-ts/oas31'; | ||
out: { | ||
[K in Type]: z.input<RequestPart<R, Part>>; | ||
[K in Type]: z.output<RequestPart<R, Part>>; | ||
}; | ||
@@ -35,3 +35,3 @@ } : {} : {}; | ||
out: { | ||
json: z.input<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>; | ||
json: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>; | ||
}; | ||
@@ -44,3 +44,3 @@ } : {} : {} : {} : {}; | ||
out: { | ||
form: z.input<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>; | ||
form: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>; | ||
}; | ||
@@ -47,0 +47,0 @@ } : {} : {} : {} : {}; |
// src/index.ts | ||
import { OpenApiGeneratorV3, OpenApiGeneratorV31, OpenAPIRegistry } from "@asteasolutions/zod-to-openapi"; | ||
import { | ||
OpenApiGeneratorV3, | ||
OpenApiGeneratorV31, | ||
OpenAPIRegistry | ||
} from "@asteasolutions/zod-to-openapi"; | ||
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi"; | ||
@@ -84,7 +88,3 @@ import { zValidator } from "@hono/zod-validator"; | ||
case "component": | ||
return this.openAPIRegistry.registerComponent( | ||
def.componentType, | ||
def.name, | ||
def.component | ||
); | ||
return this.openAPIRegistry.registerComponent(def.componentType, def.name, def.component); | ||
case "route": | ||
@@ -101,6 +101,3 @@ return this.openAPIRegistry.registerPath({ | ||
case "schema": | ||
return this.openAPIRegistry.register( | ||
def.schema._def.openapi._internal.refId, | ||
def.schema | ||
); | ||
return this.openAPIRegistry.register(def.schema._def.openapi._internal.refId, def.schema); | ||
case "parameter": | ||
@@ -107,0 +104,0 @@ return this.openAPIRegistry.registerParameter( |
{ | ||
"name": "@hono/zod-openapi", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "A wrapper class of Hono which supports OpenAPI.", | ||
@@ -34,3 +34,3 @@ "type": "module", | ||
"devDependencies": { | ||
"hono": "^3.5.8", | ||
"hono": "^3.6.3", | ||
"zod": "^3.22.1" | ||
@@ -37,0 +37,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26622
354