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

Add support for ValidatorBuilder joining/flatMapping #277

Open
alexshavlovsky opened this issue Sep 5, 2022 · 2 comments
Open

Add support for ValidatorBuilder joining/flatMapping #277

alexshavlovsky opened this issue Sep 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@alexshavlovsky
Copy link

alexshavlovsky commented Sep 5, 2022

Given:

        @Getter
        @Setter
        class Payload {
            private String field1;
            private String field2;
            private String field3;
        }

        ValidatorBuilder<Payload> vb1 = ValidatorBuilder.<Payload>of()
                ._string(Payload::getField1, "field1", c -> c.notNull());

        ValidatorBuilder<Payload> vb2 = ValidatorBuilder.<Payload>of()
                ._string(Payload::getField1, "field2", c -> c.notNull());

why not allow doing this:

        ValidatorBuilder<Payload> joinedValidator = ValidatorBuilder.<Payload>join(vb1, vb2);

and this:

        ValidatorBuilder<Payload> vb3 = ValidatorBuilder.<Payload>of()
                ._string(Payload::getField3, "field3", c -> c.notNull())
                .flatMap(vb1)
                .flatMap(vb2);
@making
Copy link
Owner

making commented Sep 5, 2022

Hi, thanks for your requests.
Can you please create separate issues for each request?

@alexshavlovsky alexshavlovsky changed the title Supprort ValidatorBuilder joining/flatMapping and add support for inheritance hierarchies validation Add support for ValidatorBuilder joining/flatMapping Sep 5, 2022
@alexshavlovsky
Copy link
Author

Actually, I think this is related to #253

@making making added the enhancement New feature or request label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants