You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2018+ is parsed into an Int32, which seems unusual. I'd imagine at the very least that discarding a non-whitespace character from the yaml is a bug, instead of throwing on something that can't be unambiguously interpreted.
The YAML spec has some example schema (schemas? schemae??), all of which seem that they would interpret the above as a string instead of a number given the regex provided in-spec for integers: 0 | -? [1-9] [0-9]*
I tested two other popular parser implementations: yaml (TypeScript), parses as string pyyaml (Python), parses as string
Would this be something that could be altered? Or is this a YamlDotNet thing?
The text was updated successfully, but these errors were encountered:
Using [Globalization.NumberStyles]::Any when parsing numbers will parse
even numbers that should be returned as strings, such as "2018+".
Explicitly using Integer and/or Float, will correclty parse integers and
scientific notation integers such as 1e+3.
Fixes: cloudbase#145
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2018+
is parsed into an Int32, which seems unusual. I'd imagine at the very least that discarding a non-whitespace character from the yaml is a bug, instead of throwing on something that can't be unambiguously interpreted.The YAML spec has some example schema (schemas? schemae??), all of which seem that they would interpret the above as a string instead of a number given the regex provided in-spec for integers:
0 | -? [1-9] [0-9]*
I tested two other popular parser implementations:
yaml
(TypeScript), parses as stringpyyaml
(Python), parses as stringWould this be something that could be altered? Or is this a YamlDotNet thing?
The text was updated successfully, but these errors were encountered: