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

Parses Version Numbers as Dates #274

Closed
splatteredbits opened this issue Aug 8, 2017 · 2 comments
Closed

Parses Version Numbers as Dates #274

splatteredbits opened this issue Aug 8, 2017 · 2 comments
Assignees

Comments

@splatteredbits
Copy link

Given this YAML:

Version: 1.2.3

YamlDotNet parses this as a date/time, e.g. 1/2/2003 12:00:00 AM.

According to the YAML specification only bare values that use ISO8601 format should be parsed as date/times.

I would expect this to get parsed as a string, e.g. "1.2.3".

@aaubry
Copy link
Owner

aaubry commented Oct 4, 2017

This is definitely a bug. Let me see what can be done to fix it.

@aaubry aaubry self-assigned this Oct 4, 2017
@EdwardCooke
Copy link
Collaborator

Without example code, I'm going with this is resolved.

using YamlDotNet.Serialization;

var deserializer = new DeserializerBuilder()
    .Build();

var yaml = "Version: 1.2.3";

var value = deserializer.Deserialize(new StringReader(yaml)) as Dictionary<object, object>;

Console.WriteLine(value["Version"].GetType());

Results in

System.String

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

No branches or pull requests

3 participants