Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions