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

Fix broken unwrap bean validation and adapt tests #50

Conversation

MelleD
Copy link
Contributor

@MelleD MelleD commented Feb 17, 2023

Copy link
Contributor

@tofi86 tofi86 left a comment

Choose a reason for hiding this comment

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

Any chance to return the index of the invalid item in the persons collection as it was until now?

@@ -76,7 +75,7 @@ public void testUnwrapList() {
assertEquals(3, validationResult.size());
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("wheels[1].screws") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull")));
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("wheels[3].screws") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull")));
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("persons[0].role") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull")));
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("persons[].role") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull")));
Copy link
Contributor

Choose a reason for hiding this comment

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

@MelleD this however was one of our inital reasons for PR #35: To get the validation to properly return the invalid item in the property path. Why is the item number missing now? Can we fix this and have it return the item number as for the wheels?

Copy link
Contributor Author

@MelleD MelleD Feb 17, 2023

Choose a reason for hiding this comment

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

@tofi86 No it's normal behavior of bean validation cause it's a Set

Same like:
Set<@Valid Person> persons = new HashSet<>();

It's not related to JsonNullable

@MelleD
Copy link
Contributor Author

MelleD commented Feb 17, 2023

Any chance to return the index of the invalid item in the persons collection as it was until now?

No how i said it's normal behavior of bean validation into a Set

@tofi86
Copy link
Contributor

tofi86 commented Feb 17, 2023

@MelleD Thanks for your quick feedback. I wasn't aware of Set validation not returning the invalid index. I guess I'm fine with that then! :-)

@tofi86
Copy link
Contributor

tofi86 commented Feb 17, 2023

At least we got the index for List ;-)

@MelleD
Copy link
Contributor Author

MelleD commented Feb 17, 2023

At least we got the index for List ;-)

:)

@wing328
Copy link
Member

wing328 commented Feb 17, 2023

if no further feedback, I'll merge it over the weekend and cut a release next week?

@wing328 wing328 merged commit 3f9974f into OpenAPITools:master Feb 20, 2023
@wing328
Copy link
Member

wing328 commented Feb 20, 2023

Thanks for the PR, which has been merged. Will try to cut a release tomorrow.

@wing328
Copy link
Member

wing328 commented Feb 21, 2023

Released:

[INFO]  * Upload of locally staged artifacts finished.
[INFO]  * Closing staging repository with ID "orgopenapitools-1298".

Waiting for operation to complete...
.........

[INFO] Remote staged 1 repositories, finished with success.
[INFO] Remote staging repositories are being released...

Waiting for operation to complete...
......

[INFO] Remote staging repositories released.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:27 min
[INFO] Finished at: 2023-02-21T14:34:56+08:00
[INFO] ------------------------------------------------------------------------

It may take sometime for the new release to be visible in https://search.maven.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants