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

filter out key words #14

Open
TerribleDev opened this issue Aug 10, 2016 · 3 comments
Open

filter out key words #14

TerribleDev opened this issue Aug 10, 2016 · 3 comments

Comments

@TerribleDev
Copy link

TerribleDev commented Aug 10, 2016

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.

@PeterCodar
Copy link

The same is true for types like "Date" and others.

@bladefist
Copy link
Owner

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.

@TerribleDev
Copy link
Author

@bladefist that's fair, like a warning box....

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

No branches or pull requests

3 participants