You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that standard keywords, such as format will be run before any custom keywords, such as transform. So if we want to transform a string BEFORE validating its format, we have to use $allOf to force the order.
In my case, we're considering using transform to turn a proprietary version number format into something close to a semver, then using the semver keyword from the ajv-semver to validate and clean up the coercion.
What would determine the order?
The order the keywords are added to ajv
The order the keywords appear in the JSONSchema
Can we count on the order?
The text was updated successfully, but these errors were encountered:
carlo-quinonez
changed the title
Order of operations for transform and custom keywords
Order of operations for transform and custom keywords
Oct 24, 2023
I understand that standard keywords, such as
format
will be run before any custom keywords, such astransform
. So if we want to transform a string BEFORE validating its format, we have to use$allOf
to force the order.In my case, we're considering using
transform
to turn a proprietary version number format into something close to a semver, then using thesemver
keyword from theajv-semver
to validate and clean up the coercion.What would determine the order?
ajv
Can we count on the order?
The text was updated successfully, but these errors were encountered: