Swagger (@Schema(required = true)) override the javax.validation message

369 Views Asked by At

We have introduced swagger to our existing spring rest application. We already had javax.validation's @NotNull to validate the payload, which was working fine.

After we introduce Swagger 3, we used @Schema(required = true) along with @NotNull. Now the Swagger override's the error message of javax.validation.

Before swagger: "XXX must not be null" which was generated by javax.validation.

After swagger : Missing required creator property 'XXX'.

Is it possible to disable swagger validation?

Thanks in advance

0

There are 0 best solutions below