FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 703 forks source link

Update version match documentation #2266

Open kjkooistra-youwe opened 4 years ago

kjkooistra-youwe commented 4 years ago

Matching version argument does not work, as it's null. Use requirements instead.

Also see https://github.com/symfony/symfony/issues/38034

xabbuh commented 4 years ago

I think we should have both examples. If the version is not derived from the path, you will still need to use the condition option. You can take a look at the Version2Controller class in the tests which contains examples for both.

kjkooistra-youwe commented 4 years ago

Hmm, but won't that require a more structural update? How will that work with multiple options enabled, for instance? https://symfony.com/doc/3.x/bundles/FOSRestBundle/versioning.html#how-to-version-your-api