Skip to content

Conversation

@csoulios
Copy link
Contributor

@csoulios csoulios commented Aug 31, 2021

This PR implements support for multiple validators to a FieldMapper.Parameter.

The Parameter#setValidator method was replaced by Parameter#addValidator that can be called multipled times
to add validation to a parameter.

All validators of a parameter will be executed in the same order as they have been added and if any of them fails all validation will failed.

@csoulios csoulios added >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.16.0 labels Aug 31, 2021
@csoulios csoulios requested a review from romseygeek August 31, 2021 15:04
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Aug 31, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM!

@csoulios csoulios added the auto-backport Automatically create backport pull requests when merged label Aug 31, 2021
@csoulios csoulios merged commit 707dd49 into elastic:master Aug 31, 2021
@csoulios csoulios deleted the param-multi-validators branch August 31, 2021 18:28
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run backport --upstream elastic/elasticsearch --pr 77073

elasticsearchmachine pushed a commit that referenced this pull request Aug 31, 2021
This PR implements support for multiple validators to a FieldMapper.Parameter.

The Parameter#setValidator method was replaced by Parameter#addValidator that can be called multipled times
to add validation to a parameter.

All validators of a parameter will be executed in the same order as they have been added and if any of them fails all validation will failed.
csoulios added a commit to csoulios/elasticsearch that referenced this pull request Sep 1, 2021
Now that multiple validators are supported (elastic#77073) we can add
a new validator instead of replacing the default param validator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.16.0 v8.0.0-alpha2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants