-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversion of strings containing only numbers #20
Comments
hi, thanks for reporting this 👍 the wrong type guessing is probably caused by a poor decision tree. the failing test: bool is_string = (end == scalar || *end); idea: it should set // (...)
if( is_string && yaml_node_is_bool( yamlNode, &bool_value ) ) {
is_bool = true;
}
if( yamlNode->data.scalar.style == YAML_SINGLE_QUOTED_SCALAR_STYLE
|| yamlNode->data.scalar.style == YAML_DOUBLE_QUOTED_SCALAR_STYLE ) {
is_string = true;
}
switch( nt )
// (...) |
Thank you for your response! YAML to JSON conversion result
|
thanks for testing this, I'll produce a new release soon |
whoops found a bug with ArduinoJSON 6.x so I'll restrict the next release to ArduinoJSON 7.x more code needs to be migrated as |
I get it. That's tough ^^; |
looks good integer: 1234567890
quoted_integer: "1234567890"
float: 12.3323
quoted_float: "12.3323" {
"integer": 1234567890,
"quoted_integer": "1234567890",
"float": 12.3323,
"quoted_float": "12.3323"
} |
Thank you for the commit! |
is it worth trying to handle both ArduinoJson 6.x and 7.x ? |
When converting from YAML to JSON using deserializeYml(), even if I explicitly specified that the numbers are strings by enclosing them in double quotes, they were converted as numbers (int, float) as shown below. I'm sorry, but I haven't been able to find out the cause yet.
YAML
YAML to JSON conversion result ( displayed with serializeJsonPretty() )
The text was updated successfully, but these errors were encountered: