When using Jsr303 annotation, to get our objects fileds checked for constraints, we have to annotate them with @Valid, this annotation is added on fileds that aren't premetives (or objects représenting premitives like : Integer) to recursively check constraints.
Until now, to annotate a field with this annotation, we check for it's type weither it's "object" or "array". Since the specification of jsonSchema seems to accept a string or an array of strings, when we use an array of strings the annotation @Valid is not added to the field, thus, the field is not checked for constraints.
for example, in the current version, if we use this jsonShema (which is valid according to specification of jsonschema)
For tests, i have just changed existing tests, please let me know if it's better to duplicate existing tests to cover this new feature even if it's the same as existing one 😃.
When using Jsr303 annotation, to get our objects fileds checked for constraints, we have to annotate them with
@Valid
, this annotation is added on fileds that aren't premetives (or objects représenting premitives like : Integer) to recursively check constraints. Until now, to annotate a field with this annotation, we check for it's type weither it's"object"
or"array"
. Since the specification of jsonSchema seems to accept a string or an array of strings, when we use an array of strings the annotation@Valid
is not added to the field, thus, the field is not checked for constraints.for example, in the current version, if we use this jsonShema (which is valid according to specification of jsonschema)
The filed
myField
will not have the annotation@Valid
and it's objects won't be validated.Some links :
PS :
For tests, i have just changed existing tests, please let me know if it's better to duplicate existing tests to cover this new feature even if it's the same as existing one 😃.