We recently upgraded one of our microservices from Spring Boot 2.2 to 2.3 and ran into a bug with hibernate validator that seems to affect all 6.1.x versions. Here is an example that reproduces the issue.
This will trigger a stack overflow...
Spring Boot 2.3.2, Java 11
To be honest, we suspected our own code as we couldn’t find anyone with the same problem. Is validating bidirectional relations a rare or bad thing to do? I would expect much more people with the same issue if it’s normal, so I’d like to know if this is a bad practice!
I would agree that unidrectional relations are more common, but I think bidrectional is pretty standard and even necessary in some scenarios, especially if you are directly serializing jpa backed objects.
Yeah, it's a bug in HV, I have a fix, running the whole test suite right now then will push and release.
That was an ugly one, thanks for the report and the test case.
I have released 6.1.6.Final. It should be synced to Maven Central sometime tomorrow.
Great! I’ll try to test our software using the new version tomorrow.