[BUG] Java Constraint Generator omits @Valid
annotation disallowing cascading validation
#2175
Closed
2 tasks done
Labels
bug
Something isn't working
Describe the bug.
When the Java Generator is used with
JAVA_CONSTRAINTS_PRESET
preset as seen here:https://github.com/istvan-nagy-epam/modelina/blob/0fc569bacafaface734b5b3eec171fa930f17847/examples/java-generate-jakarta-constraint-annotation/index.ts#L3-L13
Using a schema like this:
https://github.com/istvan-nagy-epam/modelina/blob/0fc569bacafaface734b5b3eec171fa930f17847/examples/java-generate-jakarta-constraint-annotation/index.ts#L14-L65
Will generate code snippets without the
@Valid
annotation in case of theObject
orCollection
types fields. This prevents cascading validation using the generated Java code. Meaning, that only thePerson
object would be validated, but neither theWebsite
nor theAddress
objects would be validated (neither as a single object nor as an element of the generated list)The currently generated code looks like this:
Expected behavior
The expected output would contain the
@Valid
annotations like this in case of thePerson
class:Screenshots
Please see example project provided here: istvan-nagy-epam@0fc569b
How to Reproduce
🥦 Browser
None
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
None
The text was updated successfully, but these errors were encountered: