New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.10.1 to 0.11.0

7

dist/index.d.ts
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
import * as openapi3_ts_oas30 from 'openapi3-ts/oas30';
import { RouteConfig, ZodMediaTypeObject, OpenAPIRegistry, ZodRequestBody, ZodContentObject, ResponseConfig } from '@asteasolutions/zod-to-openapi';
import { ZodMediaTypeObject, OpenAPIRegistry, RouteConfig as RouteConfig$1, ZodRequestBody, ZodContentObject, ResponseConfig } from '@asteasolutions/zod-to-openapi';
import { OpenAPIObjectConfig } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator';
import { Env, Context, TypedResponse, Input, Handler, Schema, Hono, ToSchema } from 'hono';
import { Env, Context, TypedResponse, Input, Handler, Schema, Hono, ToSchema, MiddlewareHandler } from 'hono';
import { MergePath, MergeSchemaPath } from 'hono/types';

@@ -11,2 +11,5 @@ import { RemoveBlankRecord } from 'hono/utils/types';

type RouteConfig = RouteConfig$1 & {
middleware?: MiddlewareHandler | MiddlewareHandler[];
};
type RequestTypes = {

@@ -13,0 +16,0 @@ body?: ZodRequestBody;

@@ -81,3 +81,4 @@ "use strict";

}
this.on([route.method], route.path.replaceAll(/\/{(.+?)}/g, "/:$1"), ...validators, handler);
const middleware = route.middleware ? Array.isArray(route.middleware) ? route.middleware : [route.middleware] : [];
this.on([route.method], route.path.replaceAll(/\/{(.+?)}/g, "/:$1"), ...middleware, ...validators, handler);
return this;

@@ -84,0 +85,0 @@ };

{
"name": "@hono/zod-openapi",
"version": "0.10.1",
"version": "0.11.0",
"description": "A wrapper class of Hono which supports OpenAPI.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -273,2 +273,28 @@ # Zod OpenAPI Hono

Or you can use the `middleware` property in the route definition.
```ts
const route = createRoute({
method: 'get',
path: '/users/{id}',
request: {
params: ParamsSchema,
},
middleware: [
prettyJSON(),
cache({ cacheName: 'my-cache' })
],
responses: {
200: {
content: {
'application/json': {
schema: UserSchema,
},
},
description: 'Retrieve the user',
},
},
})
```
### RPC Mode

@@ -275,0 +301,0 @@

Sorry, the diff of this file is not supported yet

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