|
if (arraySchema.schema().required()) { |
|
return arraySchema.schema().required(); |
|
} |
According to the comments of ArraySchema annotation, ArraySchema.schema defines the model of the items within the array, while ArraySchema.arraySchema defines the model for the model of the array itself.
Hence the code should be changed to use:
if (arraySchema.arraySchema().required()) {
return arraySchema.arraySchema().required();
}