Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reference view in array item rules #1832

Closed
hueniverse opened this issue May 31, 2019 · 0 comments
Closed

Change reference view in array item rules #1832

hueniverse opened this issue May 31, 2019 · 0 comments
Assignees
Labels
breaking changes Change that can breaking existing code
Milestone

Comments

@hueniverse
Copy link
Contributor

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
@hueniverse hueniverse added the breaking changes Change that can breaking existing code label May 31, 2019
@hueniverse hueniverse added this to the 16.0.0 milestone May 31, 2019
@hueniverse hueniverse self-assigned this May 31, 2019
@hueniverse hueniverse added the v16 label Aug 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code
Projects
None yet
Development

No branches or pull requests

1 participant