2

I've a question about the syntax of this json:

{
"trace_system": [
    {
      "id": 1,
      "name": "Test"
    },
    {
      "id": 2,
      "name": "Test2"
    }
  ]
}

is better put an underscore delimiter so: trace_system or using the camel case: traceSystem? What you suggest and why?

IlDrugo
  • 1,899
  • 3
  • 12
  • 19

1 Answers1

1

I usually prefer the camelCase convention, so your json should be:

{
"traceSystem": [
    {
      "id": 1,
      "name": "Test"
    },
    {
      "id": 2,
      "name": "Test2"
    }
  ]
}

I don't like very much the _ 'cause for some tool as Json2C# could create a wrong class and doesn't seems a good format anyway.

As suggested by this topic, there isn't a default standard that you can follow, this depends by your team. But as I said I suggest the camelCase convention.

Community
  • 1
  • 1
Dillinger
  • 1,823
  • 4
  • 33
  • 78