You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ npx tsoa spec
Generate swagger error.
GenerateMetadataError: Found 2 different model definitions for model PostBody: orig: [{"fileName":"src/TestController.ts","pos":53}], act: [{"fileName":"src/Test2Controller.ts","pos":53}]
in 'Test2Controller.post'
at /workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/methodGenerator.js:104:23
at Array.map (<anonymous>)
at MethodGenerator.buildParameters (/workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/methodGenerator.js:96:14)
at MethodGenerator.Generate (/workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/methodGenerator.js:66:33)
at /workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/controllerGenerator.js:46:41
at Array.map (<anonymous>)
at ControllerGenerator.buildMethods (/workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/controllerGenerator.js:46:14)
at ControllerGenerator.Generate (/workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/controllerGenerator.js:35:27)
at /workspaces/workspace/node_modules/@tsoa/cli/dist/metadataGeneration/metadataGenerator.js:210:41
at Array.map (<anonymous>)
Possible Solution
I think #1498 caused the problem
because Found 2 different model definitions... error message is added at this PR.
Did it uncover a bug or create a bug? FWIW I think this was a bug before that is now fixed
type PostBody of TestController.ts and type PostBody of Test2Controller.ts are not the same type.
If it is not a bug, all of the non-exported internal type must have different name.
Is it right?
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
If I use @tsoa/[email protected],
tsoa spec
runs without error.sample: https://codesandbox.io/p/devbox/tsoa-project-forked-y3vmtd
Current Behavior
If I use @tsoa/[email protected],
tsoa spec
fails like followingssample: https://codesandbox.io/p/devbox/tsoa-project-84ng5t
Possible Solution
I think #1498 caused the problem
because
Found 2 different model definitions...
error message is added at this PR.Steps to Reproduce
in https://codesandbox.io/p/devbox/tsoa-project-84ng5t
run
npx tsoa spec
ornpx tsoa routes
Context (Environment)
Version of the library: 6.0.0-rc.5
Version of NodeJS: 18
Detailed Description
Please see codesandbox examples.
Breaking change?
The text was updated successfully, but these errors were encountered: