@hono/zod-openapi 0.8.3 → 0.8.5

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.js CHANGED
@@ -29,6 +29,7 @@ var import_zod_to_openapi = require("@asteasolutions/zod-to-openapi");
29
29
  var import_zod_to_openapi2 = require("@asteasolutions/zod-to-openapi");
30
30
  var import_zod_validator = require("@hono/zod-validator");
31
31
  var import_hono = require("hono");
32
+ var import_url = require("hono/utils/url");
32
33
  var import_zod = require("zod");
33
34
  var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
34
35
  openAPIRegistry;
@@ -113,12 +114,12 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
113
114
  case "route":
114
115
  return this.openAPIRegistry.registerPath({
115
116
  ...def.route,
116
- path: `${path}${def.route.path}`
117
+ path: (0, import_url.mergePath)(path, def.route.path)
117
118
  });
118
119
  case "webhook":
119
120
  return this.openAPIRegistry.registerWebhook({
120
121
  ...def.webhook,
121
- path: `${path}${def.webhook.path}`
122
+ path: (0, import_url.mergePath)(path, def.webhook.path)
122
123
  });
123
124
  case "schema":
124
125
  return this.openAPIRegistry.register(def.schema._def.openapi._internal.refId, def.schema);
package/dist/index.mjs CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
8
8
  import { zValidator } from "@hono/zod-validator";
9
9
  import { Hono } from "hono";
10
+ import { mergePath } from "hono/utils/url";
10
11
  import { z, ZodType } from "zod";
11
12
  var OpenAPIHono = class _OpenAPIHono extends Hono {
12
13
  openAPIRegistry;
@@ -91,12 +92,12 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
91
92
  case "route":
92
93
  return this.openAPIRegistry.registerPath({
93
94
  ...def.route,
94
- path: `${path}${def.route.path}`
95
+ path: mergePath(path, def.route.path)
95
96
  });
96
97
  case "webhook":
97
98
  return this.openAPIRegistry.registerWebhook({
98
99
  ...def.webhook,
99
- path: `${path}${def.webhook.path}`
100
+ path: mergePath(path, def.webhook.path)
100
101
  });
101
102
  case "schema":
102
103
  return this.openAPIRegistry.register(def.schema._def.openapi._internal.refId, def.schema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/zod-openapi",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "A wrapper class of Hono which supports OpenAPI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16,9 +16,14 @@
16
16
  },
17
17
  "exports": {
18
18
  ".": {
19
- "types": "./dist/index.d.mts",
20
- "import": "./dist/index.mjs",
21
- "require": "./dist/index.js"
19
+ "import": {
20
+ "types": "./dist/index.d.mts",
21
+ "default": "./dist/index.mjs"
22
+ },
23
+ "require": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ }
22
27
  }
23
28
  },
24
29
  "license": "MIT",