Open TrevorDMartin opened 1 year ago
Hello there TrevorDMartin 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
If two different endpoints define the same variable for a type only one type is represented in the schema.
~~I know this was the secondary issue described here, but this is the issue giving me the runaround today. Hypothetical example that follows the structure of what I'm trying to accomplish:~~
Upon further reading of the initial issue, the whole description is actually what I'm experiencing so I'll truncate my initial restating of the problem.
My thoughts on some potential solutions:
CollidingType_{n}
for all collisions
Ultimately I think if I had been presented with a warning or error that the collision occurred, just that would have been acceptable. Changing the variable name for the type was trivial, but it was trying to find out where the erasure of the second type was coming from that took time. Any chance of a config option to opt into a 'strict no collisions' mode?
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
All types are generated separate from each other. No field collision
Current Behavior
Types are colliding and adding fields to other types or overriding types with the same variable name
Types written like:
results in a schema like:
ALSO
If two different endpoints define the same variable for a type only one type is represented in the schema.
Steps to Reproduce
I made a repository with similar settings as the one I'm working in to reproduce the bug.
git clone https://github.com/TrevorDMartin/tsoa-type-vs-interface/tree/main
generated/swagger.json
/complex-schema
have additional fields attachedController is located at
src/schema-test/SchemaTestController.ts
There are three seperate files, one for each endpoint, where the data and types are defined.
src/schema-test/CollisionTypes.ts
src/schema-test/ComplexTypes.ts
src/schema-test/SimpleTypes.ts
Context (Environment)
Version of NodeJS: 18.15.0 Version of Typescript: ^5.0.4
Current Workaround
Changing the parent type in
src/schema-test/ComplexTypes.ts
from an interface to a type results in no more extra fields: