Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hono/zod-openapi

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/zod-openapi - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

6

dist/index.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc