It would be useful to have a coercible string representation for null. "null" or '' would work just fine.
I think also that the coercion should happen only when the subject doesn't match any of the allowed types.
Currently, given the following subject
and the following schema
{
"properties": {
"value": {
"type": ["boolean", "string"]
}
},
"type": "object"
}
"value" is coerced to boolean, even if its type -- string -- is among the allowed ones.
What do you think?
It would be useful to have a coercible string representation for null. "null" or '' would work just fine.
I think also that the coercion should happen only when the subject doesn't match any of the allowed types.
Currently, given the following subject
{ "value": "true" }and the following schema
{ "properties": { "value": { "type": ["boolean", "string"] } }, "type": "object" }"value" is coerced to boolean, even if its type -- string -- is among the allowed ones.
What do you think?