Skip to content

Get the property name of the current node that is being evaluated #767

@gk12277

Description

@gk12277
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions