ajv-validator / ajv-validator/ajv-i18n

make an option to use title instead of property name if title is available

Aberta
#101 0 comentários 6 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
JavaScript
Estrelas
180
Forks
91
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I am using ajv with ajv-i18n to localize validation messages, which is great.

Problem is on required properties, since it is using the property name in the message. Is it possible to use the title instead if available?

It would be benneficial even for english speaking users since instead of this:
```should have required property 'firstName'```
user would see this:
```should have required property 'First Name'```

Example schema with title

```js
const registerJsonSchema = {
type: 'object',
properties: {
firstName: { type: 'string', title: 'Meno', minLength: 2, maxLength: 20 },
...
},
required: ['firstName', ...],
};
```

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.