api-platform / api-platform/core

[RFC] Json Schema Validations

Aperta
#2,131 9 commenti 2 reazioni 0 assegnatari Vedi su GitHub
OpenAPI RFC
Lingua principale
PHP
Stelle
2.6k
Fork
980
Merge medio
2g 5h
PR unite (30g)
48

Descrizione

What would you think about allowing JSON Schema Validations for API Resources that we could then expose inside of the generated OpenAPI documentation file?

Most of the basic symfony validations like Assert\Blank, Assert\Length etc are values that could be defined via the json schema vocabulary and a library like https://github.com/justinrainbow/json-schema would be able to parse and validate those definitions.

I don't think this would obviate the need for symfony validations because you might still want to use a custom validation rule or maybe check the db for uniqueness, but a lot of the simple stuff could easily be written as json schema validations.

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.