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

fix same poperty name confliction #250

Merged

Conversation

AyumiSashitani
Copy link
Contributor

@AyumiSashitani AyumiSashitani commented Jul 17, 2024

Issue Description

I addresses the issue #235 where model file names conflict if different paths use the same property key.

Expected Results

The generated code should distinguish between the data properties of /foo and /bar responses.

Actual Results

Only one Data model is created for both responses.

What I Changed

Modified the open_api_parser.dart file to increment object names when duplicate type names are found.
Added a check for duplicate type names and incremented the object name if a duplicate is detected.

Thank you for considering this PR.
I look forward to your feedback!

Thank you.

@Carapacik Carapacik self-requested a review July 18, 2024 20:41
@Carapacik Carapacik added bug Something isn't working enhancement New feature or request labels Jul 18, 2024
@Carapacik Carapacik linked an issue Jul 18, 2024 that may be closed by this pull request
@Carapacik Carapacik merged commit b46c30f into Carapacik:main Jul 19, 2024
4 checks passed
@AyumiSashitani AyumiSashitani deleted the fix/model_property_name_confliction branch July 19, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

model file name conflict if different paths use same property key
2 participants