ajv-validator / ajv-validator/ajv-errors
ErrorMessage with Array of strings
- Lenguaje dominante
- TypeScript
- Estrellas
- 289
- Forks
- 21
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hey everybody,
I have some issues when i'm trying to put errorMessage with an array, for example, this is my schema :
```
"pictures": {
"type": "array",
"items": {
"type": "string",
"pattern": "A_SPECIFIC_PATTERN_TO_PUT_HERE"
},
"errorMessage": {
"type": "INVALID_MEDIA_PICTURES_ITEMS",
}
},
```
When the pattern doesn't match, I don't receive errorMessage keyword, but instead :
```
error {
keyword: 'pattern',
dataPath: '/media/pictures/0',
schemaPath: 'media-schema.json/properties/pictures/items/pattern',
params: {
pattern: 'A_SPECIFIC_PATTERN_TO_PUT_HERE'
},
message: 'should match pattern A_SPECIFIC_PATTERN_TO_PUT_HERE'
}
```
I would like to receive my `INVALID_MEDIA_PICTURES_ITEMS`. I have the feeling errorMessage only works with `type: object`
Am I missing something here ?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.