@hono/zod-openapi 0.8.5 → 0.8.6

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
@@ -69,8 +69,8 @@ declare class OpenAPIHono<E extends Env = Env, S extends Schema = {}, BasePath e
69
69
  openapi: <R extends RouteConfig, I extends Input = InputTypeBase<R, "params", "param"> & InputTypeBase<R, "query", "query"> & InputTypeBase<R, "headers", "header"> & InputTypeBase<R, "cookies", "cookie"> & InputTypeForm<R> & InputTypeJson<R>, P extends string = ConvertPathType<R["path"]>>(route: R, handler: Handler<E, P, I, HandlerResponse<OutputType<R>>>, hook?: Hook<I, E, P, OutputType<R>> | undefined) => OpenAPIHono<E, S & ToSchema<R["method"], P, I["in"], OutputType<R>>, BasePath>;
70
70
  getOpenAPIDocument: (config: OpenAPIObjectConfig) => openapi3_ts_oas30.OpenAPIObject;
71
71
  getOpenAPI31Document: (config: OpenAPIObjectConfig) => openapi3_ts_oas31.OpenAPIObject;
72
- doc: (path: string, config: OpenAPIObjectConfig) => void;
73
- doc31: (path: string, config: OpenAPIObjectConfig) => void;
72
+ doc: <P extends string>(path: P, config: OpenAPIObjectConfig) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
73
+ doc31: <P extends string>(path: P, config: OpenAPIObjectConfig) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
74
74
  route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): OpenAPIHono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>;
75
75
  route<SubPath extends string>(path: SubPath): Hono<E, RemoveBlankRecord<S>, BasePath>;
76
76
  basePath<SubPath extends string>(path: SubPath): OpenAPIHono<E, S, MergePath<BasePath, SubPath>>;
package/dist/index.d.ts CHANGED
@@ -69,8 +69,8 @@ declare class OpenAPIHono<E extends Env = Env, S extends Schema = {}, BasePath e
69
69
  openapi: <R extends RouteConfig, I extends Input = InputTypeBase<R, "params", "param"> & InputTypeBase<R, "query", "query"> & InputTypeBase<R, "headers", "header"> & InputTypeBase<R, "cookies", "cookie"> & InputTypeForm<R> & InputTypeJson<R>, P extends string = ConvertPathType<R["path"]>>(route: R, handler: Handler<E, P, I, HandlerResponse<OutputType<R>>>, hook?: Hook<I, E, P, OutputType<R>> | undefined) => OpenAPIHono<E, S & ToSchema<R["method"], P, I["in"], OutputType<R>>, BasePath>;
70
70
  getOpenAPIDocument: (config: OpenAPIObjectConfig) => openapi3_ts_oas30.OpenAPIObject;
71
71
  getOpenAPI31Document: (config: OpenAPIObjectConfig) => openapi3_ts_oas31.OpenAPIObject;
72
- doc: (path: string, config: OpenAPIObjectConfig) => void;
73
- doc31: (path: string, config: OpenAPIObjectConfig) => void;
72
+ doc: <P extends string>(path: P, config: OpenAPIObjectConfig) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
73
+ doc31: <P extends string>(path: P, config: OpenAPIObjectConfig) => OpenAPIHono<E, S & ToSchema<"get", P, {}, {}>, BasePath>;
74
74
  route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): OpenAPIHono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>;
75
75
  route<SubPath extends string>(path: SubPath): Hono<E, RemoveBlankRecord<S>, BasePath>;
76
76
  basePath<SubPath extends string>(path: SubPath): OpenAPIHono<E, S, MergePath<BasePath, SubPath>>;
package/dist/index.js CHANGED
@@ -91,13 +91,13 @@ var OpenAPIHono = class _OpenAPIHono extends import_hono.Hono {
91
91
  return document;
92
92
  };
93
93
  doc = (path, config) => {
94
- this.get(path, (c) => {
94
+ return this.get(path, (c) => {
95
95
  const document = this.getOpenAPIDocument(config);
96
96
  return c.json(document);
97
97
  });
98
98
  };
99
99
  doc31 = (path, config) => {
100
- this.get(path, (c) => {
100
+ return this.get(path, (c) => {
101
101
  const document = this.getOpenAPI31Document(config);
102
102
  return c.json(document);
103
103
  });
package/dist/index.mjs CHANGED
@@ -69,13 +69,13 @@ var OpenAPIHono = class _OpenAPIHono extends Hono {
69
69
  return document;
70
70
  };
71
71
  doc = (path, config) => {
72
- this.get(path, (c) => {
72
+ return this.get(path, (c) => {
73
73
  const document = this.getOpenAPIDocument(config);
74
74
  return c.json(document);
75
75
  });
76
76
  };
77
77
  doc31 = (path, config) => {
78
- this.get(path, (c) => {
78
+ return this.get(path, (c) => {
79
79
  const document = this.getOpenAPI31Document(config);
80
80
  return c.json(document);
81
81
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/zod-openapi",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "A wrapper class of Hono which supports OpenAPI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",