Custom messages.properties
Is there a way to override the messages produced in validation-report?
Comments (5)
-
-
As Pawel says, this is the “standard” Java way to shadow things on the classpath.
If this doesn’t meet your needs (or you would like a more explicit way to do this) please feel free to re-open the ticket to discuss and/or raise a PR for the change.
Thanks.
-
- changed status to resolved
-
May I know how do i ensure that my own swagger/validation/messages.properties will be before the lib on the classpath? Please see stackoverflow: https://stackoverflow.com/questions/69928806/overwrite-properties-in-java-library
-
Hi @James Navin , i just follow your guide on how to customize the message. But i can only custom the message from swagger-request-validator, other schema validation messages come from json-schema-validation cannot. Is this a default behavior of this library ?
e.g:validation.schema.invalidJson=My Custom Message.
can work.validation.request.parameter.schema.type
cannot work because it from json-schema-validator.
- Log in to comment
What I did I put messege.propeties file under in swagger/validation directory in the resources. If your swagger/validation/message.properties file is before the lib one on the classpath, you will be able to override properties.