0

Design webapi,

returned json data if a key does not exist,

Use null or do not use this key which is better?

For example:

{ "Id": "001", "name": "a", "addr": null}

or

{ "Id": "001", "name": "a"}

Clients have ios, android, web

Tyler
  • 173
  • 9

1 Answers1

0

its a better that you not use key for those which are returning null or empty value. preferable is that you use { "Id": "001", "name": "a"}

Bhagvan
  • 21
  • 2