Download the PHP package basilicom/json-schema-request-validator-bundle without Composer
On this page you can find all versions of the php package basilicom/json-schema-request-validator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basilicom/json-schema-request-validator-bundle
More information about basilicom/json-schema-request-validator-bundle
Files in basilicom/json-schema-request-validator-bundle
Package json-schema-request-validator-bundle
Short Description Easily validate Symfony request bodies via JSON schema and automatically reject invalid requests
License MIT
Informations about the package json-schema-request-validator-bundle
JSON Schema Request Validator Bundle
Easily validate Symfony request bodies via JSON schema and automatically reject invalid requests
Version
Version | Symfony |
---|---|
1.x | 3.4.x or 4.1.x |
2.x | 5.3.x |
Installation
via composer
add to \App\Kernel
Usage
The controller needs to implement the JsonSchemaRequestValidationControllerInterface
.
All request bodies of its actions then will be validated with JSON schema files set via the interface method setJsonSchemaFilePathsInFilePathProvider(FilePathProvider $filePathProvider)
.
All actions of this controller must have a JSON schema file which must be mapped via the route name.
The system automatically rejects an invalid incoming requests with status code "400 Bad Request". If no JSON schema file can be found it will respond with "500 Internal Server Error".
Example Symfony controller
All versions of json-schema-request-validator-bundle with dependencies
symfony/http-kernel Version ^5.3
symfony/http-foundation Version ^5.3
symfony/config Version ^5.3
symfony/dependency-injection Version ^5.3
justinrainbow/json-schema Version ^5.2