JsonUtils
JsonUtils copied to clipboard
filter out key words
I have noticed when place json in that contains a keyword as a property, it will end up being called that in the c# code which will not compile.
For example
{
"private": true
}
result:
public class PullRequestHook
{
[JsonProperty("private")]
public bool private { get; set; }
}
This won't compile since private is a keyword.
keywords such as ref, head, base, async,private, protected, etc
should switch cases, or rename the properties in some manor so it will compile.
The same is true for types like "Date" and others.
Understood. I feel like that is something that should be called out to the developer so that they are aware the mapping wont be 1:1.
@bladefist that's fair, like a warning box....