mi / rest-extra-bundle
Helper to avoid annotations with FOSRestBundle and SensioFrameworkExtraBundle
Installs: 14 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.0
- friendsofsymfony/rest-bundle: ^3.0
- sensio/framework-extra-bundle: ^6.1
Requires (Dev)
README
Overview
...
Installation
- Add this bundle to your project as a composer dependency:
composer require mi/rest-extra-bundle
-
Add this bundle in your application kernel:
// app/AppKernel.php public function registerBundles() { // ... $bundles[] = new \Mi\Bundle\RestExtraBundle\MiRestExtraBundle(); return $bundles; }
Usage
ParamConverterListener
```yaml
#routing.yml
mi_rest_extra_create:
...
defaults:
...
_converters:
note:
name: note
converter: fos_rest.request_body
class: Mi\RestExtra\Core\Model\Note
```
ParamFetcherListener
```yaml
#routing.yml
mi_rest_extra_create:
...
defaults:
...
_params:
startDate:
strict: true
nullable: false
```
ViewListener
```yaml
#routing.yml
mi_rest_extra_create:
...
defaults:
...
_view:
serializerGroups: [list]
```
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
This library is under the MIT license.