You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have a question regarding the usage of Bean Validation in Kotlin for subtypes in a polymorphic deserialization.
Here's an example that illustrates the scenario:
data classShape(
@NotBlank @Pattern(regexp ="SQUARE|CIRCLE") valtype:String,
@JsonTypeInfo(use =NAME, include =EXTERNAL_PROPERTY, property ="type")
@JsonSubTypes(
value = [
Type(value =Square::class, name ="SQUARE"),
Type(value =Circle::class, name ="CIRCLE")
]
)
valbase:Base
)
data classSquare(@Min(1) valside:Int) : Base()
data classCircle(@Min(1) valradius:Int) : Base()
sealedclassBase
In the code above, the validation of the type property works fine. However, the validation for the properties of the subclasses is currently being ignored.
I would appreciate any help or guidance you can provide!
The text was updated successfully, but these errors were encountered:
Hello! I have a question regarding the usage of
Bean Validation
inKotlin
for subtypes in a polymorphic deserialization.Here's an example that illustrates the scenario:
In the code above, the validation of the type property works fine. However, the validation for the properties of the subclasses is currently being ignored.
I would appreciate any help or guidance you can provide!
The text was updated successfully, but these errors were encountered: