ajv-validator / ajv-validator/ajv

Add support for Standard Schema

Aperta
#2,605 2 commenti 3 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
14.8k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.