@hono/zod-openapi 0.11.0 → 0.11.1
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -56,7 +56,7 @@ type Hook<T, E extends Env, P extends string, O> = (result: {
|
|
|
56
56
|
} | {
|
|
57
57
|
success: false;
|
|
58
58
|
error: ZodError;
|
|
59
|
-
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void
|
|
59
|
+
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void | Promise<void>;
|
|
60
60
|
type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}` ? `${Start}/:${Param}${ConvertPathType<Rest>}` : T;
|
|
61
61
|
type HandlerTypedResponse<O> = TypedResponse<O> | Promise<TypedResponse<O>>;
|
|
62
62
|
type HandlerAllResponse<O> = Response | Promise<Response> | TypedResponse<O> | Promise<TypedResponse<O>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ type Hook<T, E extends Env, P extends string, O> = (result: {
|
|
|
56
56
|
} | {
|
|
57
57
|
success: false;
|
|
58
58
|
error: ZodError;
|
|
59
|
-
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void
|
|
59
|
+
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void | Promise<void>;
|
|
60
60
|
type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}` ? `${Start}/:${Param}${ConvertPathType<Rest>}` : T;
|
|
61
61
|
type HandlerTypedResponse<O> = TypedResponse<O> | Promise<TypedResponse<O>>;
|
|
62
62
|
type HandlerAllResponse<O> = Response | Promise<Response> | TypedResponse<O> | Promise<TypedResponse<O>>;
|
package/dist/index.js
CHANGED
|
@@ -79,7 +79,13 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
const middleware = route.middleware ? Array.isArray(route.middleware) ? route.middleware : [route.middleware] : [];
|
|
82
|
-
this.on(
|
|
82
|
+
this.on(
|
|
83
|
+
[route.method],
|
|
84
|
+
route.path.replaceAll(/\/{(.+?)}/g, "/:$1"),
|
|
85
|
+
...middleware,
|
|
86
|
+
...validators,
|
|
87
|
+
handler
|
|
88
|
+
);
|
|
83
89
|
return this;
|
|
84
90
|
};
|
|
85
91
|
getOpenAPIDocument = (config) => {
|
package/dist/index.mjs
CHANGED
|
@@ -57,7 +57,13 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
const middleware = route.middleware ? Array.isArray(route.middleware) ? route.middleware : [route.middleware] : [];
|
|
60
|
-
this.on(
|
|
60
|
+
this.on(
|
|
61
|
+
[route.method],
|
|
62
|
+
route.path.replaceAll(/\/{(.+?)}/g, "/:$1"),
|
|
63
|
+
...middleware,
|
|
64
|
+
...validators,
|
|
65
|
+
handler
|
|
66
|
+
);
|
|
61
67
|
return this;
|
|
62
68
|
};
|
|
63
69
|
getOpenAPIDocument = (config) => {
|