Skip to content

Change reference view in array item rules #1832

@hueniverse

Description

@hueniverse

When using references in schemas used to validate array items:

  • array().items()
  • array().ordered()

The references no longer point to the object containing the array itself. Instead, they point to the individual array item being validated. This means that a previous reference of Joi.ref('peer') must now be expressed as Joi.ref('...peer'). This is because:

  • x and .x are now properties of the array item being validated
  • ..x is a property of full array being validated
  • ...x is a property of the object containing the array

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions