New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error, Multiple matching models found #79
Comments
@myflowpl I had the same issue with Issue happens because TSOA uses TypeScript's I don't see an easy way to resolve this issue. |
@amozh thanks for deep explanation of the issue.
After some time, when the model list got quite big, i found it easier to maintain and read the project structure with suffixes, so it was god workaround for me. |
I am also getting with @typings Error: Multiple matching models found for referenced type Response; please make model names unique. Conflicts found: "/usr/local/lib/node_modules/tsoa/node_modules/typescript/lib/lib.d.ts"; "/Users/xxx/node_modules/@types/express-serve-static-core/index.d.ts". How to fix this? |
@isman-usoh I noticed you tagged this in progress - did you have a solution in the works? |
I'm running into the same issue as @Cidaas above, "Multiple matching models found" for basic typing definitions (
|
Check out the latest release (2.0.1+). While there isn't a true fix, there's now a way to ignore directories for TypeScript scanning, e.g. in tsoa.json:
My guess is that most folks only want to expose domain-specific models, not interfaces/classes from external libs. That may not be totally true. In any case, this will help you resolve the above issue. Let me know what you think. |
@lukeautry Thanks for the update. That is a step closer and may fully fix the issue for some. In my case I have another bug that has came up, probably need it's own ticket - the error is regarding use of
This is thrown from src/metadataGeneration/resolveType.ts (my models have I appear to have solved the issue by mapping String to string in resolveType.ts around line 76. Is this the best solution?
In the mean time I've forked the module for my own use with this fix, but I think this should be handled in tsoa. Edit - I've submitted PR #172 |
I am also getting error for Request object
My config file. I am using {
"swagger": {
"outputDirectory": "./dist",
"entryFile": "./src/Routers/entryfile.ts",
"basePath": "/v1",
"name": "vimal",
"description": "vimal"
},
"ignore": [
"**/node_modules/**"
]
}
|
See the @tsoamodel feature (new): https://github.com/lukeautry/tsoa#dealing-with-duplicate-model-names |
Hi, I saw your feature is only to resolve the same model name, but how can i resolve the same namespace definition in different files ? Thanks in advance. |
Any solution to this? I've tried ignoring the paths in the tsoa config as well as using the @tsoaModel decorator.
|
Link moved to: |
I have this error when generating routes or swagger
It's true, i have two interfaces with the same name, but they are in different packages,
one is used internally by the service,
and the other in the controller (for tsoa router and swagger generation)
Is there a way to fis this error other then rename the interface ?
The text was updated successfully, but these errors were encountered: