symfony3 Routing Powerful Rest Routes


Traditionally, you can use routing to map an the request with the Routing Component who handled request and response parameters by HttpFoundation Component.

Additionally, a custom route parameter can be created by using the FOSRestBundle to extends the default functionalities of the Routing Component.

This is useful for creating REST routes, an really useful to specify how to tranfer structured data like XML or json file in a request (and a response).

See FOSRestBundle Doc for more information, and especially this annotation :

use FOS\RestBundle\Controller\Annotations\FileParam;

 * @FileParam(
 *   name="",
 *   key=null,
 *   requirements={},
 *   default=null,
 *   description="",
 *   strict=true,
 *   nullable=false,
 *   image=false
 * )