Skip to content
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

Bugfix: Tag resolving for "int" and "float" #479

Closed
wants to merge 3 commits into from

Conversation

bernd5
Copy link

@bernd5 bernd5 commented Apr 3, 2020

Missing support for 10.3.2. Tag Resolution

-> only null and bool were "resolved" correctly

@pensono
Copy link
Contributor

pensono commented Apr 18, 2020

Is there a test case to exercise this functionality?

@bernd5
Copy link
Author

bernd5 commented Apr 18, 2020

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.

@aaubry
Copy link
Owner

aaubry commented Apr 19, 2020

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.

@bernd5
Copy link
Author

bernd5 commented Apr 19, 2020

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...

@EdwardCooke
Copy link
Collaborator

This PR appears to be abandoned, it's over a year old. I'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants