Replies: 2 comments 2 replies
-
Yes, it is bizarre, why not try to convert string to integer if the user asks it explicitly? Some JSON libs (in Java for example) encode integers as strings or real values only. I wasted some time to solve the issue, why my binary crashes on a valid JSON document until I looked into the sources. |
Beta Was this translation helpful? Give feedback.
1 reply
-
The are two main issues:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently asInt, asDouble, asBool are able to convert numeric values between each other, but in cases when you have a numeric or a boolean value wrapped into a string they throw an exception.
It does look like as methods are in general conversion methods and not the real representation of an underlying value, so I'm wondering if there is any reason to not support conversion or values like "999.9" or "true".
It would have been super helpful and will reduce some duplicated extra code in the places where it is used.
If there is no some huge violation in something by adding it then I am even willing to code it and send as a pull request.
Beta Was this translation helpful? Give feedback.
All reactions