0

The result returned from webapi shown below

[{
"id": 1,
"name": "TEST 1",
"no": 35797506102858582
}]

The value of the "no" property is returned wrongly as 35797506102858584 when json result displayed. Ex:https://jsoneditoronline.org/?id=6f97f53689e24222ba931bdeee70f836

What is the cause of the problem ? How can i fix..

Joshua
  • 40,822
  • 8
  • 72
  • 132
stackCoder
  • 205
  • 1
  • 2
  • 13
  • 1
    what is your actual question – Vivek ab May 21 '18 at 11:29
  • @Vivekab What is the cause of the problem? – stackCoder May 21 '18 at 12:20
  • I can't reproduce any problem parsing and displaying your JSON with [tag:json.net], see https://dotnetfiddle.net/08K3C4 Thus this question seems to have nothing to do with that tag. I can confirm that the web site https://jsoneditoronline.org/ shows the wrong value for `"no"`. It has a github page here: https://github.com/josdejong/jsoneditor, so maybe you could report an [issue](https://github.com/josdejong/jsoneditor/issues). Beyond that I think this may be off-topic for Stack Overflow. – dbc May 21 '18 at 20:07
  • Maybe this is relevant: [Javascript long integer](https://stackoverflow.com/questions/17320706/javascript-long-integer). If so, you'll need to represent your `id` as a string not an integer. – dbc May 21 '18 at 20:08
  • @dbc i reproduce the same scenario with Newtonsoft.Json 7.0.1. i think there is a bug at this version. – stackCoder May 22 '18 at 08:55

1 Answers1

2

put the no value inside double quotes

[{
"id": 1,
"name": "TEST 1",
"no": "35797506102858582"
}]
Vivek ab
  • 660
  • 6
  • 15