Handling of integer value of zero
Integer value of zero is being set to blank in React due to improper handling of these values. I add a function in objectUtils.js though I am not sure if that's the best place to keep it.
I had to revert a validation changes and it was throwing exception for me. You may ignore that revert if things are looking good to you.
The commit "Validate properties from oneOf (86979b6)" is throwing me the following exception and that is why I had to revert it.
Uncaught TypeError: validator[type] is not a function
I can't replicate your issue. In http://ismaelga.github.io/react-json-editor/ 0 is parsed correctly both with number and integer types.
Use this schema to test it yourself
{
"type": "object",
"properties": {
"integer": {
"title": "Integer",
"type": "integer"
},
"number": {
"title": "Number",
"type": "number"
}
}
}
Strange. I tried the schema you just provided and fields show up as blank for me. I am passing {"integer": 0, "number": 0.0} as value.
Oh ok. I was testing it in a different way. I will try that later
On 29 Jan 2016, at 21:25, Amit Srivastava [email protected] wrote:
Strange. I tried the schema you just provided and fields show up as blank for me. I am passing {"integer": 0, "number": 0.0} as value.
— Reply to this email directly or view it on GitHub https://github.com/ismaelga/react-json-editor/pull/16#issuecomment-176975369.
Can you send a new PR without the "Revert "Validate properties from oneOf"? I will fix it before merging