schema = {
"type": "object",
"properties":{
"name": {
"type": "string",
"newKey: "value",
}
},
}
def function_1(validator, properties, instance, schema):
pass
Draft4Validator.VALIDATORS["newKey"] = function_1
Draft4Validator(schema).validate({"name":"123"})
function_1 will be called for each occurrence of newKey is it possible to get the name of the current node that is being evaluated ie. is it possible to get the key name inside function_1.
When I checked was only able to get value of key name 123, value of newKey value and the schema.
I need the specific key that is being evaluated that is name in this case.
function_1 will be called for each occurrence of
newKeyis it possible to get the name of the current node that is being evaluated ie. is it possible to get the keynameinside function_1.When I checked was only able to get value of key name
123, value of newKeyvalueand the schema.I need the specific key that is being evaluated that is
namein this case.