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

bug: props with optional getters should be validated #165

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

timyates
Copy link
Contributor

@timyates timyates commented Jul 4, 2023

Previously in 3.x a class with optional getters was still validated.

This reproducer tests this case, and shows that it currently fails to validate.

If you remove the getter from the POGO, then the test passes.

This was discovered in building the hibernate-reactive guide where we have the following validated DTO:

https://github.com/micronaut-projects/micronaut-guides/blob/ab0bfb2c117de73b24aabbb9422ec58dadaebb8d/guides/micronaut-hibernate-reactive/java/src/main/java/example/micronaut/SortingAndOrderArguments.java

Previously in 3.x a class with optional getters was still validated.

This reproducer tests this case, and shows that it currently fails to validate.

This was discovered in building the hibernate-reactive guide where we have the following validated DTO:

https://github.com/micronaut-projects/micronaut-guides/blob/ab0bfb2c117de73b24aabbb9422ec58dadaebb8d/guides/micronaut-hibernate-reactive/java/src/main/java/example/micronaut/SortingAndOrderArguments.java
@sdelamo
Copy link
Contributor

sdelamo commented Jul 4, 2023

This seems related to #114 and micronaut-projects/micronaut-core#9203

@sdelamo
Copy link
Contributor

sdelamo commented Jan 8, 2024

@timyates lets annotate this with @PendingFeature so we can merge it.

@timyates
Copy link
Contributor Author

timyates commented Jan 9, 2024

@sdelamo done, and I raised an issue #281 to make sure we don't forget

Copy link

sonarqubecloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@sdelamo sdelamo linked an issue Jan 9, 2024 that may be closed by this pull request
@sdelamo sdelamo merged commit a15809a into master Jan 9, 2024
11 checks passed
@sdelamo sdelamo deleted the bug-optional-getters branch January 9, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

bug: props with optional getters should be validated
3 participants