Skip to content
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

Mechanism for handling duplicate component class names #5062

Open
peterbrostl1979 opened this issue Dec 6, 2024 · 0 comments
Open

Mechanism for handling duplicate component class names #5062

peterbrostl1979 opened this issue Dec 6, 2024 · 0 comments

Comments

@peterbrostl1979
Copy link

Is your feature request related to a problem? Please describe.

This feature request stems from my problem with a large json where the method parameters share the same class name but have different ancestor paths like.

  • "$ref": "#/components/schemas/RootNamespace.Contracts.FunctionalityOne.InputType"
  • "$ref": "#/components/schemas/RootNamespace.Contracts.FunctionalityTwo.InputType"
  • "$ref": "#/components/schemas/RootNamespace.Contracts.FunctionalityThree.InputType"
  • ...

This results in classes being generated with names InputType, InputType1, InputType2,...

Describe the solution you'd like

I can imagine two possible solutions, either to have an option to prefix the class name with their ancestor(s) or introduce a custom attribute in the schema definition indicating the target class name somehow (not sure if openapi allows that however)

Describe alternatives you've considered

The cleanest alternative would be to fix the json here, however that is not (easily) possible in all situations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant