-
Notifications
You must be signed in to change notification settings - Fork 45
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
YAML Specific symbols support: .inf, .nan, ~, and multi-documents #24
Comments
some examples? |
According to the YAML Spec 1.2.2 section "10.2.1.4. Floating Point", and "2.2. Structures". Input YAML: key1: .inf
key2: .nan
key3: ~
---
key4: Second
key5: Document Output JSONs: {
"key1": 2147483647,
"key2": 0,
"key3": null
} {
"key4": "Second",
"key5": "Document"
} |
you change the value of the data, it not looks good for me. (I know json do not allow +Inf/-Inf/Nan ) |
You made this great Go lib, thank you. It's always up to you. But this lib might be better with this little changes. Maybe, it can be applied as an additional optional parameters for converter function to force convert YAML specific symbols? |
Thanks for your example. I will make it convertible. |
In future version (may be tag as v1.3.3):
|
I have looked inside this repo to find if it able to convert some YAML specific symbols like
.inf
,.-inf
,.nan
, and~
.In one of my own projects, when I have needed to same conversion from YAML to JSON it was resolved as:
.inf
=2147483647
(math.MaxInt32)-.inf
=-2147483648
(math.MinInt32).nan
=0
~
=null
And what about YAML multi-document files?
It might be 2 functions where first will fetch only first document (by compatibility reasons) and processes it as JSON, and second fetches all documents and returns array of JSON converted docs.
The text was updated successfully, but these errors were encountered: