@hono/zod-openapi 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @hono/zod-openapi
2
2
 
3
+ ## 1.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1514](https://github.com/honojs/middleware/pull/1514) [`565d0e3e89523da773a3570fd1084f3ed7e41036`](https://github.com/honojs/middleware/commit/565d0e3e89523da773a3570fd1084f3ed7e41036) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: change middleware type from MiddlewareHandler to H
8
+
9
+ Update RouteConfig middleware field type to use H (Handler | MiddlewareHandler union) instead of MiddlewareHandler. This aligns with Hono's on() method type expectations and resolves type errors introduced in Hono v4.10.0+.
10
+
11
+ The H type is the correct type for handlers passed to Hono's on() method, and this change maintains runtime compatibility while fixing TypeScript compilation errors.
12
+
13
+ ## 1.1.3
14
+
15
+ ### Patch Changes
16
+
17
+ - [#1469](https://github.com/honojs/middleware/pull/1469) [`db68e22a9edee796c8692ef84cdc21be79566718`](https://github.com/honojs/middleware/commit/db68e22a9edee796c8692ef84cdc21be79566718) Thanks [@BarryThePenguin](https://github.com/BarryThePenguin)! - Remove `SimplifyDeepArray` usage, see https://github.com/honojs/hono/pull/4406
18
+
3
19
  ## 1.1.2
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { RouteConfig as RouteConfig$1, ZodRequestBody, ZodContentObject, ZodMediaTypeObject, OpenApiGeneratorV3, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
2
2
  export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
3
- import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
4
- import { MergePath, MergeSchemaPath } from 'hono/types';
3
+ import { TypedResponse, Env, ValidationTargets, Context, MiddlewareHandler, Input, Handler, Schema, Hono, ToSchema } from 'hono';
4
+ import { H, MergePath, MergeSchemaPath } from 'hono/types';
5
5
  import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
6
- import { SimplifyDeepArray, JSONValue, JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
6
+ import { JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
7
7
  import { OpenAPIObject } from 'openapi3-ts/oas30';
8
8
  import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
9
9
  import { ZodType, z, ZodError } from 'zod';
@@ -11,7 +11,7 @@ export { z } from 'zod';
11
11
 
12
12
  type MaybePromise<T> = Promise<T> | T;
13
13
  type RouteConfig = RouteConfig$1 & {
14
- middleware?: MiddlewareHandler | MiddlewareHandler[];
14
+ middleware?: H | H[];
15
15
  hide?: boolean;
16
16
  };
17
17
  type RequestTypes = {
@@ -23,7 +23,7 @@ type RequestTypes = {
23
23
  };
24
24
  type IsJson<T> = T extends string ? T extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? 'json' : never : never : never;
25
25
  type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}` | `application/x-www-form-urlencoded${infer _Rest}` ? 'form' : never : never;
26
- type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<SimplifyDeepArray<Content> extends JSONValue ? JSONValue extends SimplifyDeepArray<Content> ? never : JSONParsed<Content> : never, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
26
+ type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<JSONParsed<Content>, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
27
27
  type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
28
28
  type HasUndefined<T> = undefined extends T ? true : false;
29
29
  type InputTypeBase<R extends RouteConfig, Part extends string, Type extends keyof ValidationTargets> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends ZodType ? {
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { RouteConfig as RouteConfig$1, ZodRequestBody, ZodContentObject, ZodMediaTypeObject, OpenApiGeneratorV3, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
2
2
  export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
3
- import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
4
- import { MergePath, MergeSchemaPath } from 'hono/types';
3
+ import { TypedResponse, Env, ValidationTargets, Context, MiddlewareHandler, Input, Handler, Schema, Hono, ToSchema } from 'hono';
4
+ import { H, MergePath, MergeSchemaPath } from 'hono/types';
5
5
  import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
6
- import { SimplifyDeepArray, JSONValue, JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
6
+ import { JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
7
7
  import { OpenAPIObject } from 'openapi3-ts/oas30';
8
8
  import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
9
9
  import { ZodType, z, ZodError } from 'zod';
@@ -11,7 +11,7 @@ export { z } from 'zod';
11
11
 
12
12
  type MaybePromise<T> = Promise<T> | T;
13
13
  type RouteConfig = RouteConfig$1 & {
14
- middleware?: MiddlewareHandler | MiddlewareHandler[];
14
+ middleware?: H | H[];
15
15
  hide?: boolean;
16
16
  };
17
17
  type RequestTypes = {
@@ -23,7 +23,7 @@ type RequestTypes = {
23
23
  };
24
24
  type IsJson<T> = T extends string ? T extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? 'json' : never : never : never;
25
25
  type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}` | `application/x-www-form-urlencoded${infer _Rest}` ? 'form' : never : never;
26
- type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<SimplifyDeepArray<Content> extends JSONValue ? JSONValue extends SimplifyDeepArray<Content> ? never : JSONParsed<Content> : never, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
26
+ type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<JSONParsed<Content>, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
27
27
  type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
28
28
  type HasUndefined<T> = undefined extends T ? true : false;
29
29
  type InputTypeBase<R extends RouteConfig, Part extends string, Type extends keyof ValidationTargets> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends ZodType ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/zod-openapi",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "A wrapper class of Hono which supports OpenAPI.",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@arethetypeswrong/cli": "^0.18.2",
50
- "hono": "^4.8.4",
51
- "publint": "^0.3.9",
50
+ "hono": "^4.10.1",
51
+ "publint": "^0.3.14",
52
52
  "tsup": "^8.5.0",
53
53
  "typescript": "^5.8.2",
54
54
  "vitest": "^3.2.4",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@asteasolutions/zod-to-openapi": "^8.1.0",
60
- "@hono/zod-validator": "^0.7.3",
60
+ "@hono/zod-validator": "^0.7.4",
61
61
  "openapi3-ts": "^4.5.0"
62
62
  },
63
63
  "engines": {