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

replace spaces with underscores in (enum) identifiers #46

Closed
NANASHI0X74 opened this issue Jun 14, 2021 · 5 comments · Fixed by #47
Closed

replace spaces with underscores in (enum) identifiers #46

NANASHI0X74 opened this issue Jun 14, 2021 · 5 comments · Fixed by #47

Comments

@NANASHI0X74
Copy link
Contributor

NANASHI0X74 commented Jun 14, 2021

Hi, I've just ran into a problem trying out this generator (switching from one of the openapi-generator-cli default ones). Our Api defines an enum with a bunch of languages and some of the names of these languages contain spaces. The generated code then contains enum definitions where individual enum values contain spaces , for example

enum languages{
..., cape Verdean,...
}

dart sees these as two seperate identifiers without a comma in between, which is invalid. One way to fix this may be to replace spaces with underscores in the enum value identifiers.

The relevant part of my spec looks something like this:

    LanguageEnum:
      enum:
      ...
      - Cape Verdean
      ...
@rvowles
Copy link
Member

rvowles commented Jun 15, 2021

ok - i wonder if pure number enums would cause issues as well.

@rvowles
Copy link
Member

rvowles commented Jun 15, 2021

try using 5.7

@NANASHI0X74
Copy link
Contributor Author

great! This solves that issue. Unfortunately there are still a few more problems, I will open new issues

@NANASHI0X74
Copy link
Contributor Author

NANASHI0X74 commented Jun 15, 2021

I've decided that this seems to be the best available null-safe code generator out there, so I'll invest some more time to analyse what all the errors are that I run into, and will be posting a slew of issues describing them if that's ok :p
Turns out I found three issues: #48 #49 #50
When I've identified all the issues I can try and help fix them myself as well

@rvowles
Copy link
Member

rvowles commented Jun 15, 2021 via email

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

Successfully merging a pull request may close this issue.

2 participants