There was a problem resolving type of 'PartialComplex'.
There was a problem resolving type of 'MyBodyDefinition'.
/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:267
throw err;
^
TypeError: Cannot read property 'filter' of undefined
at getModelTypeProperties (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:463:47)
at getModelTypeProperties (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:459:15)
at getReferenceType (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:250:26)
at resolveType (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:80:25)
at /tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:452:23
at Array.map (<anonymous>)
at getModelTypeProperties (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:418:14)
at getReferenceType (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:250:26)
at resolveType (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:91:25)
at Object.resolveType (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:60:16)
at MethodGenerator.generate (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/methodGenerator.js:46:34)
at /tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:87:58
at Array.map (<anonymous>)
at ControllerGenerator.buildMethodsForClass (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:87:14)
at ControllerGenerator.buildMethods (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:69:43)
at ControllerGenerator.generate (/tmp/failure/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:48:27)
For the record, the rest of the files have this content:
swagger:
outputDirectory: ./dist
entryFile:
- ./src/services/*
outputFormat: OpenApi_3
name: Mock server example
description: This is a test
license: Unlicensed
produces: [application/json]
securityDefinitions:
default:
type: http
scheme: bearer
name: Authorization
Hi everyone!
I recently realized I cannot use
Partial
. For example this works:src/services/index.ts
But if you change
MyBodyDefinition
to:then the output is:
For the record, the rest of the files have this content:
package.json:
swagger.config.yml:
tsconfig.json
Thanks for your help.