Skip to content

Unit deserialization does not work when unit or value are in lowercase #568

@dschuermans

Description

@dschuermans

When providing a json such as this:

{ "unit": "LengthUnit.Meter", "value": 12 }

The TryDeserializeIComparable function fails because it attempts to find "Unit" and "Value" keys on the JToken.
JToken appears to be case sensitive so another way around it is to cast JToken to JObject and then use .GetValue(nameofValueUnit.Unit), StringComparison.OrdinalIgnoreCase)as per https://stackoverflow.com/questions/49886411/json-net-jtoken-keys-are-case-sensitive?noredirect=1&lq=1

Will post fix soon as i'm working on it right now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions