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

The string "null" should be deserialized as a string, not as null #106

Closed
mstefarov opened this issue Jun 16, 2022 · 0 comments · Fixed by #112
Closed

The string "null" should be deserialized as a string, not as null #106

mstefarov opened this issue Jun 16, 2022 · 0 comments · Fixed by #112

Comments

@mstefarov
Copy link

I have a piece of YAML that contains the string literal "null". Other YAML parsers (e.g. YamlDotNet) treat this as a string "null", but SharpYaml interprets it as just null.

Example:

values:
  - name: "null"
    value: 5
    summary: No fill.
public class YEnum
{
    public List<YEnumValue> Values { get; set; } = new();
}
public class YEnumValue
{
    public string Name { get; set; }
    public int Value { get; set; }
    public string Summary { get; set; }
}

Expected deserialization result: myEnum.Values[0].Name == "null"
Actual deserialization result: myEnum.Values[0].Name == null

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 a pull request may close this issue.

1 participant