Skip to content

Wrong behavior with deep rules #63

@rahpuser

Description

@rahpuser

Using the following description throws and unexpected error:

{
  "type": "object",
  "fields": {
    "testKey": {
      "type": "object",
      "required": true,
      "fields": {
        "anotherTest": [
          {
            "type": "object",
            "required": true,
            "fields": {
              "testField": {
                "type": "string",
                "required": true
              },
            }
          }
        ]
      }
    }
  }
}

schema.validate({ testKey: {} }, (err, res) => {...

This throws the following error:
Cannot read property 'testField' of undefined

Is there something wrong in the descriptor or is there something else to configure to make this validation work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions