Custom messages.properties

Issue #343 resolved
Former user created an issue

Is there a way to override the messages produced in validation-report?

Comments (5)

  1. Paweł Weselak

    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.

  2. James Navin

    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.

  3. Minh Duc Cao

    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.

  4. Log in to comment