-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add Support For Yaml Bool #40
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! If you don't mind I have a request to make this patch even better. Let me know what you think!
src/yaml.zig
Outdated
const isTruthy = std.mem.eql(u8, raw, "true"); | ||
const isFalsy = std.mem.eql(u8, raw, "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am no YAML expert but I think we should handle all possible variants for a boolean:
y|Y|yes|Yes|YES|n|N|no|No|NO|
true|True|TRUE|false|False|FALSE|
on|On|ON|off|Off|OFF
taken from https://stackoverflow.com/questions/53648244/specifying-the-string-value-yes-in-yaml#53648738
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will look into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubkon I checked the yaml specification and it seems y|Y|yes|Yes|YES|n|N|no|No|NO
is a backwards-compatible support but it will be nice to have for this project.
I have gone ahead to include it in this PR. Hopefully, it is optimal enough. I was looking for a constant solution but so far this is what I have come up with
…support-for-yaml-bool
This PR suggest a fix for yaml boolean value particularly true and false value. This was as a result of a boolean usecase
Error Detail:
Proposition:
Since the parse value to a yaml field can also be true or false, this case should be handled. This PR proposes a possiblity for that.