json-schema
json-schema copied to clipboard
coerce
Hi!
Wouldn't it be better to apply coercion (if defined in the schema and available in exports) only if the value hadn't passed type test, and not unconditionally?
Best regards, --Vladimir
This is fixed in your pull, right?
Not really. I didn't get how to achieve that. In pull I added support to validate objects in arrays, plus changed validate() signature to support options hash (since a bunch of options are added).
I introduced existingOnly option which control whether only existing in instance properties will be validating (very useful for validating partial updates), and filter option which controls whether non-specified in the schema properties should add errors when additionalProperties is false (this is useful to validate only a subset of instance properties)