{"action":"created","issue":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1255","repository_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle","labels_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1255/labels{/name}","comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1255/comments","events_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1255/events","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1255","id":304509682,"number":1255,"title":"`@SWG\\{operation}()` not working properly with controller inheritance","user":{"login":"phansys","id":1231441,"avatar_url":"https://avatars0.githubusercontent.com/u/1231441?v=4","gravatar_id":"","url":"https://api.github.com/users/phansys","html_url":"https://github.com/phansys","followers_url":"https://api.github.com/users/phansys/followers","following_url":"https://api.github.com/users/phansys/following{/other_user}","gists_url":"https://api.github.com/users/phansys/gists{/gist_id}","starred_url":"https://api.github.com/users/phansys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phansys/subscriptions","organizations_url":"https://api.github.com/users/phansys/orgs","repos_url":"https://api.github.com/users/phansys/repos","events_url":"https://api.github.com/users/phansys/events{/privacy}","received_events_url":"https://api.github.com/users/phansys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-12T19:30:44Z","updated_at":"2018-03-20T01:06:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm using the annotation `FOS\\RestBundle\\Controller\\Annotations\\Get` in order to define routes. While deprecating some features, my API has at least 2 versions coexisting at same time, so I use the `condition` parameter to define a constraint at \"Accept\" header in order to allow clients to choose which API to consume:\r\n```yaml\r\n# routing.yml\r\nuser_v2:\r\n    type: rest\r\n    resource: Controller\\Rest\\V2\\UserController\r\n    options:\r\n        expose: true\r\n\r\nuser_v1:\r\n    type: rest\r\n    resource: Controller\\Rest\\V1\\UserController\r\n    options:\r\n        expose: true\r\n```\r\n```php\r\nclass UserV2 extends FOSRestController\r\n{\r\n    /**\r\n     * @Get(\"/user\", condition=\"request.headers.get('Accept') matches '/;version=v2([;]|$)/i'\")\r\n     */\r\n    public function getUserAction() {}\r\n}\r\n```\r\n```php\r\nclass UserV1 extends UserV2\r\n{\r\n    /**\r\n     * @Get(\"/user\", condition=\"not(request.headers.get('Accept') matches '/;version=v[0-9]/i') or request.headers.get('Accept') matches '/;version=v1([;]|$)/i'\")\r\n     */\r\n    public function getUserAction() {}\r\n}\r\n```\r\nThis works pretty good with my stable setup and `nelmio/api-doc-bundle (2.13.3)`. Now I'm trying to update to version 3.x, but I'm facing `E_USER_NOTICE` errors like `Unable to merge @SWG\\Get() in UserController->getUserAction()`.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/comments/374437593","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1255#issuecomment-374437593","issue_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1255","id":374437593,"user":{"login":"phansys","id":1231441,"avatar_url":"https://avatars0.githubusercontent.com/u/1231441?v=4","gravatar_id":"","url":"https://api.github.com/users/phansys","html_url":"https://github.com/phansys","followers_url":"https://api.github.com/users/phansys/followers","following_url":"https://api.github.com/users/phansys/following{/other_user}","gists_url":"https://api.github.com/users/phansys/gists{/gist_id}","starred_url":"https://api.github.com/users/phansys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phansys/subscriptions","organizations_url":"https://api.github.com/users/phansys/orgs","repos_url":"https://api.github.com/users/phansys/repos","events_url":"https://api.github.com/users/phansys/events{/privacy}","received_events_url":"https://api.github.com/users/phansys/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T01:06:52Z","updated_at":"2018-03-20T01:06:52Z","author_association":"CONTRIBUTOR","body":"As you can see on #1267, the tests are [failing](https://travis-ci.org/nelmio/NelmioApiDocBundle/builds/355650373) because the described issue:\r\n```\r\n[critical] Uncaught PHP Exception PHPUnit\\Framework\\Error\\Notice: \"Unable to merge @SWG\\Get() in \\ApiController->fetchArticleAction() in /home/travis/build/nelmio/NelmioApiDocBundle/Tests/Functional/Controller/ApiController.php\" at /home/travis/build/nelmio/NelmioApiDocBundle/vendor/zircote/swagger-php/src/Logger.php line 38\r\n```\r\nBut I'm able to confirm that the problem is originated by using the same routing prefix (`@Route(\"/api\")`) in both controllers (regardless the child controller has no documentation annotations at all)."}}
{"actor":{"display_login":"phansys"}}