Provide config option to resolve duplicate model names #798
odaom
started this conversation in
Feature request
Replies: 1 comment
-
Bumping this issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an OpenAPI spec that has two endpoints with the same operationId ("raw-data"). Their paths are ".../node3/raw-data" and ".../node4/raw-data". The generator doesn't create a model for the Node 3 200 response, because of a name collision with the Node 4 200 response.
What I want is a a config option to resolve this issue.
As a suggestion, the option could be to include the first tag in the class name to create unique model class names. The grouping within the "api" module into separate folders based on the first tag ("node3/raw_data.py" and "node4/raw_data.py", respectively) prevents name collisions there. I want something similar for the models.
Using "class_override" in the config doesn't work, because both of the RawDataResponse200 model classes are renamed and the issue persists.
What I'm doing currently is manually editing my OpenAPI spec before running the generator. I don't have any detailed control of how my OpenAPI spec is generated, it comes from a third party program. It would be great to not have to do this manually, since the generator output becomes inconsistent (suddenly there's an endpoint method in the client library with a name different from the API endpoint) and it's harder to maintain.
Here is the relevant warning message:
and here are the relevant parts of my OpenAPI spec that can be used to recreate the issue
Beta Was this translation helpful? Give feedback.
All reactions