FriendsOfSymfony/FOSRestBundle — pull request #178 by asm89 (2012-01-31 22:32:46+00:00)
Title: [PoC] @QueryParam validation

*Please note that this is a proof-of-concept. It is subject to change.*

As discussed with @everzet and @lsmith on IRC some while ago.

The idea is that controllers can be annotated with the optional parameters that are used. These parameters can then be requested via a `query_fetcher` service that will "validate" the parameters and return a default value if the validation fails.

As extra bonus the `@QueryParam` annotation can contain a description which can be used for api documentation.

```php
get('fos_rest.request.query_fetcher');
$sorter = $qf->getParameter('sorter', 'date_asc');
$page = $qf->getParameter('page', '1');

// etc..
}
}
```