-1

I have a JSON schema (from ADP) that has parts of its JSON that looks like this:

...
"noteIndicator" : {
          "description" : "True indicates that the System of Record supports the user entering notes / comments.  If the value is false then the notes / comments field will not be visible in the UI",
          "type" : "boolean",
          "optional" : true,
          "default" : false
        }

When I use a JSON to C# converter, "default" gets marked as a keyword in C# rather than a field name. Is there anyway I can use an attribute or otherwise make the C# compiler not look at the word "default" as a keyword, but a field name? Is the answer as simple as changing the word "default" to something else?

1
  • You didn't show the C# part where it gets marked. If you doing it like this, then note what JsonPropertyAttribute does, then you can indeed change the name of property to something else. Commented Jan 5, 2018 at 15:41

1 Answer 1

4

Prefix the names (variables, properties or fields) that conflict in your C# code with @.

Sign up to request clarification or add additional context in comments.

1 Comment

Json2csharp.com will automatically do this for you.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.