YamlDotNet
YamlDotNet copied to clipboard
Bugfix: Tag resolving for "int" and "float"
Missing support for 10.3.2. Tag Resolution
-> only null and bool were "resolved" correctly
Is there a test case to exercise this functionality?
If you deserialize a yaml file with following content, the values were interpreted not as numbers (you got them as string):
SomeIntValue: 42
SomeFloatValue: 12.1
Please have a look at YamlSpec 10.3.2. Tag Resolution.
Boolean and Null value deserialization was done fine already.
The section of the spec that you mention refers to the "Core" schema, which is not the default one that parser should provide. I don't think this should be the default behaviour. Once we implement proper support for schemas, we'll be able to select the "Core" schema and have the behaviour you desire.
What is the default one that a parser should provide?
If you deserialize this yaml file and serialize it back you loose the type info. You get:
SomeIntValue: "42"
SomeFloatValue: "12.1"
In addition you could argue for bool and null equally. You could deserialze those values to the strings "" or "true", "false"... But this would be very bad...
This PR appears to be abandoned, it's over a year old. I'm going to close it.