albanian-xrm / PowerPlatform-Entity-Serializer

This library can serialize an Microsoft.Xrm.Sdk.Entity to Json and back using System.Text.Json
MIT License
2 stars 0 forks source link

Case insensitive `key` and `value` tags #2

Open ArneMancofi opened 5 months ago

ArneMancofi commented 5 months ago

In AlbanianXrm.PowerPlatform.JsonConverters.AttributeCollectionConverter.Read(...), shouldn't the switch on the tag be case insensitive, for instance by replacing

switch (str)
{
  case "key":
    // ...
  case "value":
    // ...
}

with

switch (str.ToLowerInvariant())
{
  case "key":
    // ...
  case "value":
    // ...
}

?

BetimBeja commented 5 months ago

Hi @ArneMancofi, in which case would the key and value be different than LowerCase?

I guess this "fix" wouldn't be a huge ask anyway. I will push this together with #1 as soon as we are ready.