Symfony bundle for wizards/php-rest-api
Helps you create a REST API in an expressive and streamlined way. It will help you conceive mature and discoverable APIs, thanks to the jsonapi specification. Regardless of the output serialization, the request format will be the same. Have a look at http://github.com/wizardstechnologies/php-rest-api for further documentation and explanations.
composer require wizards/rest-bundle
Register it in your AppKernel
new Wizards\RestBundle\WizardsRestBundle(),
Create a configuration file with the following values:
# config/bundles/wizards_rest.yaml
wizards_rest:
data_source: orm|array # Choose between ORM and Array for your data source. More will be added soon
reader: annotation|array
format: jsonapi|array
base_url: your_url
Create a REST API the easy and configurable way !
This bundle ease the use of wizard's php rest api, and provide some extra goodies for symfony:
- a subscriber to automatically serialize your responses
- a subscriber to automatically serialize your exceptions
- a param converter to inject PSR-7 requests in your controllers
- a multi-part exception to easily serialize multiple errors (such as the one from forms)
- a controller trait that helps on serializing input data from json and jsonapi
- Configure your data source
- Expose your endpoints