Skip to content

adding allOf validation and test cases #438

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

Merged
merged 3 commits into from
Mar 7, 2025
Merged

Conversation

ShivKJ
Copy link
Contributor

@ShivKJ ShivKJ commented Feb 27, 2025

Adding validation for allOf

@ShivKJ ShivKJ mentioned this pull request Feb 27, 2025
@making
Copy link
Owner

making commented Feb 27, 2025

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

@@ -42,6 +42,7 @@ enum Default implements ViolationMessage {
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
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

@making making added feedback required enhancement New feature or request labels Feb 27, 2025
@ShivKJ
Copy link
Contributor Author

ShivKJ commented Mar 1, 2025

#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
Copy link
Owner

@making making left a comment

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
4 checks passed
@making
Copy link
Owner

making commented Mar 7, 2025

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