@hono/zod-openapi
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -54,3 +54,3 @@ import * as openapi3_ts_oas30 from 'openapi3-ts/oas30'; | ||
constructor(); | ||
openapi: <R extends RouteConfig, I extends Input = InputTypeBase<R, "params", "param"> & InputTypeBase<R, "query", "query"> & InputTypeForm<R> & InputTypeJson<R>, P extends string = ConvertPathType<R["path"]>>(route: R, handler: Handler<E, P, I, OutputType<R>>, hook?: Hook<I, E, P, OutputType<R>> | undefined) => Hono<E, ToSchema<R["method"], P, I["in"], OutputType<R>>, BasePath>; | ||
openapi: <R extends RouteConfig, I extends Input = InputTypeBase<R, "params", "param"> & InputTypeBase<R, "query", "query"> & InputTypeBase<R, "headers", "header"> & InputTypeBase<R, "cookies", "cookie"> & InputTypeForm<R> & InputTypeJson<R>, P extends string = ConvertPathType<R["path"]>>(route: R, handler: Handler<E, P, I, OutputType<R>>, hook?: Hook<I, E, P, OutputType<R>> | undefined) => Hono<E, ToSchema<R["method"], P, I["in"], OutputType<R>>, BasePath>; | ||
getOpenAPIDocument: (config: OpenAPIObjectConfig) => openapi3_ts_oas30.OpenAPIObject; | ||
@@ -57,0 +57,0 @@ doc: (path: string, config: OpenAPIObjectConfig) => void; |
@@ -42,2 +42,10 @@ var __accessCheck = (obj, member, msg) => { | ||
} | ||
if (route.request?.headers) { | ||
const validator = zValidator("header", route.request.headers, hook); | ||
validators.push(validator); | ||
} | ||
if (route.request?.cookies) { | ||
const validator = zValidator("cookie", route.request.cookies, hook); | ||
validators.push(validator); | ||
} | ||
const bodyContent = route.request?.body?.content; | ||
@@ -44,0 +52,0 @@ if (bodyContent) { |
{ | ||
"name": "@hono/zod-openapi", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "A wrapper class of Hono which supports OpenAPI.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -9,3 +9,2 @@ # Zod OpenAPI Hono | ||
- Currently, it does not support validation of _headers_ and _cookies_. | ||
- An instance of Zod OpenAPI Hono cannot be used as a "subApp" in conjunction with `rootApp.route('/api', subApp)`. | ||
@@ -12,0 +11,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21803
274
224