Skip to content

adding allOf validation and test cases#438

Merged
making merged 3 commits into
making:developfrom
ShivKJ:feature-all-of
Mar 7, 2025
Merged

adding allOf validation and test cases#438
making merged 3 commits into
making:developfrom
ShivKJ:feature-all-of

Conversation

@ShivKJ

@ShivKJ ShivKJ commented Feb 27, 2025

Copy link
Copy Markdown
Contributor

Adding validation for allOf

@ShivKJ ShivKJ mentioned this pull request Feb 27, 2025
@making

making commented Feb 27, 2025

Copy link
Copy Markdown
Owner

First of all, thank you for the proposal.

Instead of test cases being a,b,c,x,y,z blah blah, please use use cases that explain why you need this feature.
I generally don't want to add built-in constants unnecessarily. I'll merge them if I think the reason makes sense after understanding the context in which they are added.

See also #191

OBJECT_EQUAL_TO("object.equalTo", "\"{0}\" must be equal to {1}"), //
OBJECT_ONE_OF("object.oneOf", "\"{0}\" must be one of the following values: {1}"), //
OBJECT_NOT_ONE_OF("object.notOneOf", "\"{0}\" must not be one of the following values: {1}"), //
OBJECT_ALL_OF("object.allOf", "\"{0}\" must be have of all of the following values: {1}, missing values: {2}"), //

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

object. prefix is not correct in this case

Comment thread src/main/java/am/ik/yavi/constraint/CollectionConstraint.java Outdated
Comment thread src/main/java/am/ik/yavi/constraint/CollectionConstraint.java Outdated
Comment thread src/main/java/am/ik/yavi/constraint/CollectionConstraint.java
@making making added feedback required enhancement New feature or request labels Feb 27, 2025
@ShivKJ

ShivKJ commented Mar 1, 2025

Copy link
Copy Markdown
Contributor Author

#438 (comment)

Instead of test cases being a,b,c,x,y,z blah blah, please use use cases that explain why you need this feature.
I generally don't want to add built-in constants unnecessarily. I'll merge them if I think the reason makes sense after understanding the context in which they are added.

@making I followed the test case format already present in the same test file. The use case is simply to verify whether all items from one collection are present in an expected collection. For example, consider a person on vacation with a planned list of places to visit. There might be certain locations they definitely want to visit. This type of validation can be useful in such scenarios.

@ShivKJ ShivKJ requested a review from making March 1, 2025 05:55

@making making left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please run ./mvnw spring-javaformat:apply for the code format

@making making merged commit 26b57c4 into making:develop Mar 7, 2025
@making

making commented Mar 7, 2025

Copy link
Copy Markdown
Owner

Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants