@hono/zod-openapi 0.14.9 → 0.15.0

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/dist/index.d.mts CHANGED
@@ -21,7 +21,7 @@ type RequestTypes = {
21
21
  cookies?: ZodType;
22
22
  headers?: ZodType | ZodType[];
23
23
  };
24
- type IsJson<T> = T extends string ? T extends `application/json${infer _Rest}` ? 'json' : never : never;
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
26
  type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
27
27
  type HasUndefined<T> = undefined extends T ? true : false;
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ type RequestTypes = {
21
21
  cookies?: ZodType;
22
22
  headers?: ZodType | ZodType[];
23
23
  };
24
- type IsJson<T> = T extends string ? T extends `application/json${infer _Rest}` ? 'json' : never : never;
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
26
  type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
27
27
  type HasUndefined<T> = undefined extends T ? true : false;
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
99
99
  if (!(schema instanceof import_zod.ZodType)) {
100
100
  continue;
101
101
  }
102
- if (mediaType.startsWith("application/json")) {
102
+ if (/^application\/([a-z-\.]+\+)?json/.test(mediaType)) {
103
103
  const validator = (0, import_zod_validator.zValidator)("json", schema, hook);
104
104
  validators.push(validator);
105
105
  }
package/dist/index.mjs CHANGED
@@ -77,7 +77,7 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
77
77
  if (!(schema instanceof ZodType)) {
78
78
  continue;
79
79
  }
80
- if (mediaType.startsWith("application/json")) {
80
+ if (/^application\/([a-z-\.]+\+)?json/.test(mediaType)) {
81
81
  const validator = zValidator("json", schema, hook);
82
82
  validators.push(validator);
83
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/zod-openapi",
3
- "version": "0.14.9",
3
+ "version": "0.15.0",
4
4
  "description": "A wrapper class of Hono which supports OpenAPI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",