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
Ajv does not clone the original data in any way, see #549 for the reasons. The rootData is always passed by the reference.
If your custom keywords modifies the data then all the keywords that execute after will have access to the modified data.
You can work around by passing both the original and the clone as two properties of the same object and either re-define your schemas accordingly or just construct the modified schema in code.
Data:
{data: {/* your data */},original: {/* the deep-clone of your data */}}
Schema:
{type: 'object',properties: {data: {/* your schema */}original: {}},additionalProperties: false}
Can I get access to the source rootData (that not changed by rules) from the custom keyword validator?
The text was updated successfully, but these errors were encountered: