In my json-schema I have defined a property as
"units":"number"
Now, using JJV validator (a json-schema implimentation), I encounter in my data model a value that is NaN. I would like to do something like this "units":["number","NaN"]
instead of doing a custom coercion function like this:
env.addTypeCoercion('number', function(x){
if( isNaN(x))
{
return 0
}
return x;
});
The JSON schema primitive types in version 4 seem not to include NaN. How could I devise a schema that allows me to express a property as a number or a NaN?