-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
'NO'/"NO" (string enum value) gets serialized to False_
?
#1653
Comments
False_
?False_
?
False_
?False_
?
@tommyjcarpenter |
@koxudaxi that's it - my original comment of trying quotes wasn't quite correct, because our openapi goes through a resolver, which spits out a fully resolved openapi that is missing the quotes - which then uses this package, and produces those results thanks so much for your help.. i will need to dig into the resolver to see if I can fix this 😢 |
Do you use pyyaml? datamodel-code-generator/datamodel_code_generator/util.py Lines 54 to 56 in 54800a1
I can see the URL( By the way, thank you for your sponsoring me 😄 |
@koxudaxi i asked my company if i could sponsor you with their money for more.. but no luck yet. you've been extremely helpful, my pleasure we are using ruamel as a preprocessing step before the generator, and that is what is losing the quotes, which only affects this This issue is near the top of the list of dumbest things I've spent time on 😂 |
I'm happy to hear the comment:smile_cat:
Can you convert the |
@koxudaxi i tried this:
but that didnt seem to work, im double checking |
Sorry, I don't understand the problem. I can generate the enum from the json file 🤔 |
@koxudaxi sorry you are right - I was looking at the wrong output 🤦 converting to JSON works! should this be noted somewhere? This was a nasty one to track down. thanks much |
I have a really bizarre issue where the string 'NO' (ISO country code for Norway - we need this literal string to be an enum value), as part of an enum, is getting serlialized to
False
we have an enum of ISO codes that includes the literal string
'NO'
- I have tried this without quotes, and with both single and doubleusing the generation flags:
we get the following output!
'NO'
becomesFalse
! Can you please let me know how to not do that?Thanks much
The text was updated successfully, but these errors were encountered: