ajv-validator / ajv-validator/ajv

Add support for Standard Schema

Aberta
#2,605 2 comentários 3 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
TypeScript
Estrelas
14.8k
Forks
1k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**What version of Ajv you are you using?**
I'm using the latest, 8.18.0

**What problem do you want to solve?**
Using [Standard Schema](https://standardschema.dev/schema) as one of the possible validation strategies would allow libraries and other components that need to handle different schema validators to abstract from the validator itself, having a unified and standard interface to interact with them. Many mainstream validators already support standard schema in a way or another. I've looked through the codebase and to the issues here and I haven't found any regarding this topic.

**What do you think is the correct solution to problem?**
While I use AJV frequently at work, I've personally little knowledge of its internals. What would be nice is to provide a sort of mechanism to make the AJV - either directly of via some sort of wrapper - compatible with the proposed standard schema interface. As of now, `ValidateFunction` returns a boolean and errors are exposed via `validate.errors` property, but having a way to adapt the output and the validator itself to those interfaces would be great.

Note: this doesn't want to be a convoluted structural change to AJV output, but it would be nice just to have an out of the box way to adapt the it directly.

**Will you be able to implement it?**
As I said, I've personally little-to-none knowledge of how AJV is implemented, so I'm afraid my input could provide little value, but I'm willing to provide help if necessary.

Guia de contribuição

Abrir o guia de contribuição

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.