I've the following schema
var schema = {
"$id": "postClientSchema.json",
"type": "object",
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"additionalProperties": false,
"dynamicDefaults": {
"Type": "gettype"
},
"properties": {
"ID": {
"type": "integer"
},
"Name": {
"type": "string"
},
"Type": {
"type": "integer"
}
}
}
I wish to overwrite the value of Type in incoming payload by the value I get from dynamicDefaults. gettype
is a custom function which returns me value for type
property.
I'm using AJV for schema validation. Thank you