-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure correct routes are generated from the config in DI Extension #94
Comments
IMO, I think we should separate 2 cleaned parts:
You could take a look on my work (still be in progress) What do you think about this, @saimaz? |
I'll take a look tomorrow. As of two parts. Maybe @mvar has some thoughts and advises? |
Sorry, no suggestions. I just don't like the name |
Thanks @mvar. I changed And I added a mapping configuration into the Abstract Collection class, so you could define yours commands in an individual class or separated classed. /**
* Mapping of the commands
*
* @var array
*/
private $mapping = [
'_all' => [
'_controller' => 'ONGRApiBundle:Collection:all',
'methods' => ['GET'],
'validator' => 'allow_get_all'
],
'_batch' => [
'_controller' => 'ONGRApiBundle:Collection:batch',
'methods' => ['POST'],
'validator' => 'allow_batch'
]
]; |
Look at the configuration docs: https://github.com/ongr-io/ApiBundle/blob/9610b53ea5bc7dd3390b4be27e7a94452a3e4cb8/Resources/doc/configuration.md
Say we have:
Routes we expect to have generated dynamicaly:
/api/v1/person POST
/api/v1/person/{id} PUT
/api/v1/person/{id} GET
/api/v1/person/_all GET
/api/v1/person/{id} DELETE
/api/v1/person/_batch POST
Routes must be pointed to specific
RestController
action.The text was updated successfully, but these errors were encountered: