Closed dickermoshe closed 7 months ago
The following schema was broken by these issues:
@dickermoshe Thank you for your input, we appreciate it!
LGTM! However, could you please try to write a E2E test to verify that enums value names are generated correctly, for a specification that only contains enums whose value names might have problems?
Done!
In the future I would recommend that the regexes also apply to Enum names. API Client generation is really tricky, it would be awesome if users could patch issue themselves with regex rather than picking another package / contributing fix for their very specific issue.
In fact, there can be many such problems and adding separate tools to enable you to fix specific problems may not be the best idea.
The best option here is to automatically fix the specification to suit the needs of the developer and the parser using dart. This is simpler than it may show at first glance, and allows you to automatically fix all specific issues when the file changes / when the spec is retrieved from the url.
But, it's also worth keeping in mind that this only applies to hard to implement/specific problems. For commonly occurring problems, it is worth considering fixing them at the parser level.
Thank you for your work, it will be merged after @Carapacik review.
Thanks!
Adds a list of words that can't be used for Enum names (e.g.
values, index...
) Doesn't allow-
in beginning of Enum name.-name
->minusName
Should it be reverse?
-name
->reverseName
Fixes https://github.com/Carapacik/swagger_parser/issues/164 https://github.com/Carapacik/swagger_parser/issues/163