JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Field names ignore case: why? #98

Closed Elwetana closed 3 years ago

Elwetana commented 3 years ago

The current implementation parses JSON from server while ignoring the case of field names. This behaviour is AFAIK implemented in file Issues/Issue.cs on line 22:

private readonly IDictionary<string, Field> _fields = new Dictionary<string, Field>(StringComparer.OrdinalIgnoreCase);

I am not sure why we have this behaviour -- JSON is case-sensitive and YouTrack can have two different fields that only differ in case (in my case it was fields Sprint and sprint). I was able to fix it by simply changing the comparer to StringComparer.Ordinal. I would be very happy to submit this simple change as pull request, or am I missing something?

Thank you.

maartenba commented 3 years ago

No idea what the reason was there to be honest. Might be OK to update it.