I am trying to fix property values when they have different value than specified.
JSON:
{
"stone": "bri"
}
I want to fix the stone property to have "brick" if it is not already "brick".
Schema:
{
"required": [
"stone"
],
"properties": {
"stone": {
"type": "string",
"if": {
"not": {
"constant": "brick"
}
},
"then": { "default": "brick" }
}
}
}
Using v4.11.4:
var ajv = new Ajv({ useDefaults: true, v5: true });
require('ajv-keywords')(ajv);
Is there any other keyword that I can use to basically change the value to the good one, or to an other value by reference?