Skip to content

[7.x] [feat] add reach-like functionality to object (#37118)#37139

Merged
toddself merged 1 commit intoelastic:7.xfrom
toddself:backport/7.x/pr-37118
May 28, 2019
Merged

[7.x] [feat] add reach-like functionality to object (#37118)#37139
toddself merged 1 commit intoelastic:7.xfrom
toddself:backport/7.x/pr-37118

Conversation

@toddself
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

* [feat] add reach-like functionality to object

In elastic#36804 we need to validate a `Partial<HttpConfig>` object which may
or may not have all the required keys attached to it.  This is the type
of use-case for `Joi.reach`, so we should expose a reach-like method on
the object validation class so that you can return the validator for a
specific key on an object.

* [fix] change to validateKey

* [fix] use throw error matcher

* [fix] use same interface for validate

* [fix] change test name]
@toddself toddself added the backport This PR is a backport of another PR label May 24, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@toddself toddself merged commit 00ee700 into elastic:7.x May 28, 2019
@toddself toddself deleted the backport/7.x/pr-37118 branch May 28, 2019 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants