vona-module-a-openapi 5.0.17 → 5.0.18

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -5,9 +5,9 @@ import { OpenApiGeneratorV3, OpenApiGeneratorV31, OpenAPIRegistry } from '@astea
5
5
  import * as ModuleInfo from '@cabloy/module-info';
6
6
  import { isEmptyObject, isNil } from '@cabloy/utils';
7
7
  import { toUpperCaseFirstChar } from '@cabloy/word-utils';
8
+ import { getTypeName, coerceWithNil } from '@cabloy/zod-query';
8
9
  import { Service, SymbolRequestMappingHandler } from 'vona-module-a-web';
9
10
  import { z } from 'zod';
10
- import { coerceWithNil } from '@cabloy/zod-query';
11
11
  import 'openapi3-ts/oas30';
12
12
  import 'openapi3-ts/oas31';
13
13
 
@@ -275,11 +275,11 @@ let ServiceOpenapi = (_dec$1 = Service(), _dec2$1 = BeanInfo({
275
275
  security,
276
276
  description: actionOpenApiOptions?.description,
277
277
  summary: actionOpenApiOptions?.summary,
278
- request: this._collectRequest(controller, actionKey, actionOpenApiOptions, controllerOpenApiOptions),
278
+ request: this._collectRequest(info, controller, actionKey, actionOpenApiOptions, controllerOpenApiOptions),
279
279
  responses: this._collectResponses(controller, actionKey, actionOpenApiOptions)
280
280
  });
281
281
  }
282
- _collectRequest(controller, actionKey, actionOpenApiOptions, controllerOpenApiOptions) {
282
+ _collectRequest(info, controller, actionKey, actionOpenApiOptions, controllerOpenApiOptions) {
283
283
  // meta
284
284
  const argsMeta = this._prepareArgsMeta(controller, actionKey, actionOpenApiOptions, controllerOpenApiOptions);
285
285
  if (!argsMeta) return;
@@ -334,6 +334,10 @@ let ServiceOpenapi = (_dec$1 = Service(), _dec2$1 = BeanInfo({
334
334
  }
335
335
  }
336
336
  if (!schema) continue;
337
+ // check schema
338
+ if (getTypeName(schema) === 'ZodAny') {
339
+ throw new Error(`Invalid OpenAPI argument type: ${info.relativeName}:${controller.name}.${actionKey}#${argumentType}`);
340
+ }
337
341
  // record
338
342
  if (argumentType === 'body') {
339
343
  // body
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-openapi",
3
3
  "type": "module",
4
- "version": "5.0.17",
4
+ "version": "5.0.18",
5
5
  "title": "a-openapi",
6
6
  "vonaModule": {
7
7
  "capabilities": {
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@asteasolutions/zod-to-openapi": "^7.3.0",
37
37
  "@cabloy/zod-errors-custom": "^1.0.13",
38
- "@cabloy/zod-query": "^1.0.14",
38
+ "@cabloy/zod-query": "^1.0.15",
39
39
  "@zhennann/currency": "^2.0.0",
40
40
  "openapi3-ts": "^4.4.0",
41
41
  "zod": "^3.25.58"