ajv-validator/ajv-errors

Not getting custom error message for "pattern" keyword

ktn05 opened this issue · 0 comments

ktn05 commented

Hi,

schema,

 name: {
    type: 'string',
    pattern: '^[A-Za-z0-9-_]+$',
    errorMessage: {
      pattern: 'letters, digits, hyphen and underscore are only allowed'
    }
  }

Im getting the default error message for 'pattern' keyword i.e "must match pattern "^[A-Za-z0-9-_]+$", instead of the message that i have defined.