@hono/zod-openapi 0.9.4 → 0.9.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 +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -105,6 +105,7 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
107
|
route(path, app) {
|
|
108
|
+
const pathForOpenAPI = path.replaceAll(/:([^\/]+)/g, "{$1}");
|
|
108
109
|
super.route(path, app);
|
|
109
110
|
if (!(app instanceof _OpenAPIHono)) {
|
|
110
111
|
return this;
|
|
@@ -116,12 +117,12 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
116
117
|
case "route":
|
|
117
118
|
return this.openAPIRegistry.registerPath({
|
|
118
119
|
...def.route,
|
|
119
|
-
path: (0, import_url.mergePath)(
|
|
120
|
+
path: (0, import_url.mergePath)(pathForOpenAPI, def.route.path)
|
|
120
121
|
});
|
|
121
122
|
case "webhook":
|
|
122
123
|
return this.openAPIRegistry.registerWebhook({
|
|
123
124
|
...def.webhook,
|
|
124
|
-
path: (0, import_url.mergePath)(
|
|
125
|
+
path: (0, import_url.mergePath)(pathForOpenAPI, def.webhook.path)
|
|
125
126
|
});
|
|
126
127
|
case "schema":
|
|
127
128
|
return this.openAPIRegistry.register(def.schema._def.openapi._internal.refId, def.schema);
|
package/dist/index.mjs
CHANGED
|
@@ -83,6 +83,7 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
route(path, app) {
|
|
86
|
+
const pathForOpenAPI = path.replaceAll(/:([^\/]+)/g, "{$1}");
|
|
86
87
|
super.route(path, app);
|
|
87
88
|
if (!(app instanceof _OpenAPIHono)) {
|
|
88
89
|
return this;
|
|
@@ -94,12 +95,12 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
94
95
|
case "route":
|
|
95
96
|
return this.openAPIRegistry.registerPath({
|
|
96
97
|
...def.route,
|
|
97
|
-
path: mergePath(
|
|
98
|
+
path: mergePath(pathForOpenAPI, def.route.path)
|
|
98
99
|
});
|
|
99
100
|
case "webhook":
|
|
100
101
|
return this.openAPIRegistry.registerWebhook({
|
|
101
102
|
...def.webhook,
|
|
102
|
-
path: mergePath(
|
|
103
|
+
path: mergePath(pathForOpenAPI, def.webhook.path)
|
|
103
104
|
});
|
|
104
105
|
case "schema":
|
|
105
106
|
return this.openAPIRegistry.register(def.schema._def.openapi._internal.refId, def.schema);
|