0 in an array is parsed into null
See original GitHub issueExpected behavior
I’m running into a crucial issue where if I enter this JSON, the “0” in the array turns into null. The expected behavior is that it should remain a “0” and be of type number, as opposed to type null. This appears to be related to #159.
Actual behavior
What actually happens is the the “0” gets turned into a null.
Steps to reproduce the behavior
Simply go to the demo here: https://rawgit.com/json-editor/json-editor/master/docs/demo.html
Paste in the JSON below, and click update form. You’ll find that the 0 has been parsed into null.
{ "array": [ 2, 0, 1 ] }
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
parsing an array of JSON objects - null value preventing upsert
I am parsing an array of objects, and there's about 12 fields in each. I am doing this with two nested for(var i...
Read more >Handling JSON null and empty arrays and objects - IBM
Handling null and empty arrays and objects used in JSON data is described. ... data with a null value is parsed into a...
Read more >Converting JSON into Javascript Objects with JSON.parse()
Revivers convert empty values and complex objects into valid Javascript ... JSON.parse() converts array data into a Javascript array.
Read more >json parse check the array if it is null or undefined - ServiceNow
Solved: bawiskar Hello All, How can I parse the json and check whether it has null value or 'value' is not added.. e.g.,...
Read more >Parsing data issue with null value - Power Platform Community
Solved: I am making an HTTP call to an API that returns data which I then use the parseJSON action. The returned data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This workaround works for me.
I like the idea. Either in the README and/or the wiki (a link to the wiki may be enough).