-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?

Shane Sepac
  • 806
  • 10
  • 20
  • You didn't show the C# part where it gets marked. If you doing it like [this](https://stackoverflow.com/a/45095157/1997232), then note what `JsonPropertyAttribute` does, then you can indeed change the name of property to something else. – Sinatr Jan 05 '18 at 15:41

1 Answers1

4

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

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445