Download the PHP package sfmok/request-input-bundle without Composer
On this page you can find all versions of the php package sfmok/request-input-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sfmok/request-input-bundle
More information about sfmok/request-input-bundle
Files in sfmok/request-input-bundle
Package request-input-bundle
Short Description Converts request data into DTO inputs objects with validation.
License MIT
Informations about the package request-input-bundle
RequestInputBundle
RequestInputBundle converts request data into DTO inputs objects with validation.
- Request data supported:
json
,xml
andform
based onContent-Type
header. - Resolve inputs arguments for controllers actions.
- Create DTO inputs outside controllers
- Validate DTO inputs objects.
- Global YAML configuration.
- Custom Configuration via Input Attribute per controller action.
Installation
Require the bundle with composer:
How to use
-
Create DTO input and implements
Sfmok\RequestInput\InputInterface
- Use DTO input in your controller action as an argument:
Validations
-
Response header
- Response body
Deserialization
Whether the request data contains invalid syntax or invalid attributes types a clear 400 json response will return:
-
Data Error
- Syntax error:
Configuration
You can also override the format using attribute input and specify the format explicitly.
Create DTO input outside controller
You just need to inject InputFactoryInterface
e.g:
License
The MIT License (MIT). Please see License File for more information.
All versions of request-input-bundle with dependencies
symfony/http-kernel Version ^6.2|^7.0
symfony/http-foundation Version ^6.2|^7.0
symfony/serializer Version ^6.2|^7.0
symfony/validator Version ^6.2|^7.0
symfony/dependency-injection Version ^6.2|^7.0
symfony/property-access Version ^6.2|^7.0