hono-openapi 1.0.7 → 1.0.8

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.cjs CHANGED
@@ -273,7 +273,10 @@ async function generatePaths(hono, ctx) {
273
273
  }
274
274
  }
275
275
  const defaultOptionsForThisMethod = ctx.options.defaultOptions?.[routeMethod];
276
- const { schema: routeSpecs, components = {} } = await getSpec(middlewareHandler, defaultOptionsForThisMethod);
276
+ const { schema: routeSpecs, components = {} } = await getSpec(
277
+ middlewareHandler,
278
+ defaultOptionsForThisMethod
279
+ );
277
280
  ctx.components = mergeComponentsObjects(ctx.components, components);
278
281
  registerSchemaPath({
279
282
  route,
package/dist/index.d.cts CHANGED
@@ -2,9 +2,9 @@ import * as openapi_types from 'openapi-types';
2
2
  import { OpenAPIV3_1 } from 'openapi-types';
3
3
  import { Env, Input, Context, Next, MiddlewareHandler, ValidationTargets, Hono } from 'hono';
4
4
  import { TypedResponse, RouterRoute, ValidationTargets as ValidationTargets$1, BlankEnv, Input as Input$1, BlankInput, Schema, BlankSchema, MiddlewareHandler as MiddlewareHandler$1 } from 'hono/types';
5
+ import { loadVendor as loadVendor$2, ToOpenAPISchemaContext } from '@standard-community/standard-openapi';
5
6
  import { Hook } from '@hono/standard-validator';
6
7
  import { loadVendor as loadVendor$1 } from '@standard-community/standard-json';
7
- import { loadVendor as loadVendor$2 } from '@standard-community/standard-openapi';
8
8
  import { StatusCode } from 'hono/utils/http-status';
9
9
  import { JSONSchema7 } from 'json-schema';
10
10
 
@@ -143,9 +143,7 @@ type ResolverReturnType = ReturnType<typeof resolver> & {
143
143
  * Override the media type of the request body, if not specified, it will be `application/json` for `json` target and `multipart/form-data` for `form` target.
144
144
  */
145
145
  media?: string;
146
- } & {
147
- [key: string]: unknown;
148
- };
146
+ } & Partial<ToOpenAPISchemaContext>;
149
147
  };
150
148
  type HandlerUniqueProperty = (ResolverReturnType & {
151
149
  target: keyof ValidationTargets$1;
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ import * as openapi_types from 'openapi-types';
2
2
  import { OpenAPIV3_1 } from 'openapi-types';
3
3
  import { Env, Input, Context, Next, MiddlewareHandler, ValidationTargets, Hono } from 'hono';
4
4
  import { TypedResponse, RouterRoute, ValidationTargets as ValidationTargets$1, BlankEnv, Input as Input$1, BlankInput, Schema, BlankSchema, MiddlewareHandler as MiddlewareHandler$1 } from 'hono/types';
5
+ import { loadVendor as loadVendor$2, ToOpenAPISchemaContext } from '@standard-community/standard-openapi';
5
6
  import { Hook } from '@hono/standard-validator';
6
7
  import { loadVendor as loadVendor$1 } from '@standard-community/standard-json';
7
- import { loadVendor as loadVendor$2 } from '@standard-community/standard-openapi';
8
8
  import { StatusCode } from 'hono/utils/http-status';
9
9
  import { JSONSchema7 } from 'json-schema';
10
10
 
@@ -143,9 +143,7 @@ type ResolverReturnType = ReturnType<typeof resolver> & {
143
143
  * Override the media type of the request body, if not specified, it will be `application/json` for `json` target and `multipart/form-data` for `form` target.
144
144
  */
145
145
  media?: string;
146
- } & {
147
- [key: string]: unknown;
148
- };
146
+ } & Partial<ToOpenAPISchemaContext>;
149
147
  };
150
148
  type HandlerUniqueProperty = (ResolverReturnType & {
151
149
  target: keyof ValidationTargets$1;
package/dist/index.js CHANGED
@@ -271,7 +271,10 @@ async function generatePaths(hono, ctx) {
271
271
  }
272
272
  }
273
273
  const defaultOptionsForThisMethod = ctx.options.defaultOptions?.[routeMethod];
274
- const { schema: routeSpecs, components = {} } = await getSpec(middlewareHandler, defaultOptionsForThisMethod);
274
+ const { schema: routeSpecs, components = {} } = await getSpec(
275
+ middlewareHandler,
276
+ defaultOptionsForThisMethod
277
+ );
275
278
  ctx.components = mergeComponentsObjects(ctx.components, components);
276
279
  registerSchemaPath({
277
280
  route,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hono-openapi",
3
3
  "description": "OpenAPI schema generator for Hono",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",