api-platform / api-platform/core

[RFC] Json Schema Validations

Open
#2,131 9 comments 2 reactions 0 assignees View on GitHub
OpenAPI RFC
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 5h
Merged PRs (30d)
48

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.