@hono/zod-openapi
Advanced tools
Comparing version 0.1.1 to 0.1.2
import * as openapi3_ts_oas30 from 'openapi3-ts/oas30'; | ||
import { RouteConfig, ZodRequestBody, ZodContentObject, ResponseConfig } from '@asteasolutions/zod-to-openapi'; | ||
import { OpenAPIObjectConfig } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator'; | ||
import { Env, Hono, Input, Handler, Schema, Context, TypedResponse } from 'hono'; | ||
import { Env, Schema, Hono, Input, Handler, ToSchema, Context, TypedResponse } from 'hono'; | ||
import { AnyZodObject, z, ZodSchema, ZodError, ZodType } from 'zod'; | ||
@@ -51,6 +51,6 @@ export { z } from 'zod'; | ||
type ConvertPathType<T extends string> = T extends `${infer _}/{${infer Param}}${infer _}` ? `/:${Param}` : T; | ||
declare class OpenAPIHono<E extends Env = Env, S = {}, BasePath extends string = '/'> extends Hono<E, S, BasePath> { | ||
declare class OpenAPIHono<E extends Env = Env, S extends Schema = {}, BasePath extends string = '/'> extends Hono<E, S, BasePath> { | ||
#private; | ||
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, Schema<R["method"], P, I["in"], OutputType<R>>, BasePath>; | ||
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>; | ||
getOpenAPIDocument: (config: OpenAPIObjectConfig) => openapi3_ts_oas30.OpenAPIObject; | ||
@@ -57,0 +57,0 @@ doc: (path: string, config: OpenAPIObjectConfig) => void; |
{ | ||
"name": "@hono/zod-openapi", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A wrapper class of Hono which supports OpenAPI.", | ||
@@ -34,3 +34,3 @@ "type": "module", | ||
"devDependencies": { | ||
"hono": "^3.4.3", | ||
"hono": "^3.5.4", | ||
"zod": "^3.22.1" | ||
@@ -40,3 +40,3 @@ }, | ||
"@asteasolutions/zod-to-openapi": "^5.5.0", | ||
"@hono/zod-validator": "^0.1.7" | ||
"@hono/zod-validator": "^0.1.8" | ||
}, | ||
@@ -46,2 +46,2 @@ "engines": { | ||
} | ||
} | ||
} |
@@ -66,3 +66,3 @@ # Zod OpenAPI Hono | ||
method: 'get', | ||
path: '/users/:id', | ||
path: '/users/{id}', | ||
request: { | ||
@@ -138,3 +138,3 @@ params: ParamsSchema, | ||
method: 'get', | ||
path: '/users/:id', | ||
path: '/users/{id}', | ||
request: { | ||
@@ -164,3 +164,3 @@ params: ParamsSchema, | ||
return c.jsonT({ | ||
id: Number(id), | ||
id, | ||
age: 20, | ||
@@ -167,0 +167,0 @@ name: 'Ultra-man', |
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
21035
Updated@hono/zod-validator@^0.1.8