Skip to content

[feat] add reach-like functionality to object#37118

Merged
toddself merged 5 commits intoelastic:masterfrom
toddself:object-reach
May 24, 2019
Merged

[feat] add reach-like functionality to object#37118
toddself merged 5 commits intoelastic:masterfrom
toddself:object-reach

Conversation

@toddself
Copy link
Copy Markdown
Contributor

Summary

In #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.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

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.
@toddself toddself added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.3.0 v8.0.0 labels May 24, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-platform

@toddself toddself requested a review from spalger May 24, 2019 18:40
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@toddself toddself requested a review from spalger May 24, 2019 21:47
Copy link
Copy Markdown
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@toddself toddself merged commit 6d1a894 into elastic:master May 24, 2019
@toddself toddself deleted the object-reach branch May 24, 2019 22:59
toddself added a commit to toddself/kibana that referenced this pull request May 24, 2019
* [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 added a commit that referenced this pull request May 28, 2019
* [feat] add reach-like functionality to object

In #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]
@joshdover joshdover added the release_note:skip Skip the PR/issue when compiling release notes label Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.3.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants