{"action":"created","issue":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1505","repository_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle","labels_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1505/labels{/name}","comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1505/comments","events_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1505/events","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1505","id":433170078,"node_id":"MDU6SXNzdWU0MzMxNzAwNzg=","number":1505,"title":"Troubles with array element and generated entity doc","user":{"login":"LuisCabrero","id":18163956,"node_id":"MDQ6VXNlcjE4MTYzOTU2","avatar_url":"https://avatars1.githubusercontent.com/u/18163956?v=4","gravatar_id":"","url":"https://api.github.com/users/LuisCabrero","html_url":"https://github.com/LuisCabrero","followers_url":"https://api.github.com/users/LuisCabrero/followers","following_url":"https://api.github.com/users/LuisCabrero/following{/other_user}","gists_url":"https://api.github.com/users/LuisCabrero/gists{/gist_id}","starred_url":"https://api.github.com/users/LuisCabrero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuisCabrero/subscriptions","organizations_url":"https://api.github.com/users/LuisCabrero/orgs","repos_url":"https://api.github.com/users/LuisCabrero/repos","events_url":"https://api.github.com/users/LuisCabrero/events{/privacy}","received_events_url":"https://api.github.com/users/LuisCabrero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-04-15T09:00:58Z","updated_at":"2019-04-17T09:39:16Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI encountered an issue while trying to specify a model as response in controller:\r\n\r\nMy controller:\r\n```\r\n/**\r\n     * Creates an account resource.\r\n     *\r\n     * @Post(\"/api/accounts\")\r\n     *\r\n     * @IsGranted(\"ROLE_ADMIN\")\r\n     *\r\n     * @SWG\\Response(\r\n     *     response=201,\r\n     *     description=\"Returns account just created\",\r\n     *     @Model(type=Account::class)\r\n     * )\r\n     *\r\n     * @SWG\\Tag(name=\"accounts\")\r\n     *\r\n     * @param Request $request\r\n     * @return Response\r\n     * @throws UnprocessableEntityHttpException\r\n     */\r\n    public function postAccountAction(Request $request) : Response { ... }\r\n```\r\n\r\nMy entity:\r\n\r\n```\r\nuse Swagger\\Annotations as SWG;\r\n\r\n/**\r\n * @ORM\\Entity(repositoryClass=\"App\\Repository\\Doctrine\\AccountRepository\")\r\n * @SWG\\Definition(required={\"name\", \"type\"}, type=\"object\", @SWG\\Xml(name=\"Account\"))\r\n */\r\nclass Account implements AccountInterface\r\n{\r\n    ...\r\n\r\n    /**\r\n     * @ORM\\Column(type=\"json\", nullable=true)\r\n     * @SWG\\Property(property=\"revenue_share\", type=\"array\")\r\n     */\r\n    private $revenue_share = [];\r\n```\r\n\r\nWhen trying to access http://localhost:8000/api/doc it throws:\r\n\r\n```\r\n{\"error\":{\"code\":500,\"message\":\"Internal Server Error\",\"exception\":[{\"message\":\"Property \\\"App\\\\Entity\\\\Account:revenueShare\\\" is an array, but no indication of the array elements are made. Use e.g. string[] for an array of string.\",\"class\":\"LogicException\",\"trace\":[{\"namespace\":\"\",\"short_class\":\"\",\"class\":\"\",\"type\":\"\",\"function\":\"\",\"file\":\"\\/opt\\/app\\/vendor\\/nelmio\\/api-doc-bundle\\/ModelDescriber\\/ObjectModelDescriber.php\",\"line\":92,\"args\":[]},{\"namespace\":\"Nelmio\\\\ApiDocBundle\\\\ModelDescriber\",\"short_class\":\"ObjectModelDescriber\",\"class\":\"Nelmio\\\\ApiDocBundle\\\\ModelDescriber\\\\ObjectModelDescriber\",\"type\":\"->\",\"function\":\"describe\",\"file\":\"\\/opt\\/app\\/vendor\\/nelmio\\/api-doc-bundle\\/Model\\/ModelRegistry.php\",\"line\":95,\"args\":[[\"object\",\"Nelmio\\\\ApiDocBundle\\\\Model\\\\Model\"],[\"object\",\"EXSyst\\\\Component\\\\Swagger\\\\Schema\"]]},{\"namespace\":\"Nelmio\\\\ApiDocBundle\\\\Model\",\"short_class\":\"ModelRegistry\",\"class\":\"Nelmio\\\\ApiDocBundle\\\\Model\\\\ModelRegistry\",\"type\":\"->\",\"function\":\"registerDefinitions\",\"file\":\"\\/opt\\/app\\/vendor\\/nelmio\\/api-doc-bundle\\/ApiDocGenerator.php\",\"line\":72,\"args\":[]},{\"namespace\":\"Nelmio\\\\ApiDocBundle\",\"short_class\":\"ApiDocGenerator\",\"class\":\"Nelmio\\\\ApiDocBundle\\\\ApiDocGenerator\",\"type\":\"->\",\"function\":\"generate\",\"file\":\"\\/opt\\/app\\/vendor\\/nelmio\\/api-doc-bundle\\/Controller\\/SwaggerUiController.php\",\"line\":53,\"args\":[]},{\"namespace\":\"Nelmio\\\\ApiDocBundle\\\\Controller\",\"short_class\":\"SwaggerUiController\",\"class\":\"Nelmio\\\\ApiDocBundle\\\\Controller\\\\SwaggerUiController\",\"type\":\"->\",\"function\":\"__invoke\",\"file\":\"\\/opt\\/app\\/vendor\\/symfony\\/http-kernel\\/HttpKernel.php\",\"line\":149,\"args\":[[\"object\",\"Symfony\\\\Component\\\\HttpFoundation\\\\Request\"],[\"string\",\"default\"]]},{\"namespace\":\"Symfony\\\\Component\\\\HttpKernel\",\"short_class\":\"HttpKernel\",\"class\":\"Symfony\\\\Component\\\\HttpKernel\\\\HttpKernel\",\"type\":\"->\",\"function\":\"handleRaw\",\"file\":\"\\/opt\\/app\\/vendor\\/symfony\\/http-kernel\\/HttpKernel.php\",\"line\":66,\"args\":[[\"object\",\"Symfony\\\\Component\\\\HttpFoundation\\\\Request\"],[\"integer\",1]]},{\"namespace\":\"Symfony\\\\Component\\\\HttpKernel\",\"short_class\":\"HttpKernel\",\"class\":\"Symfony\\\\Component\\\\HttpKernel\\\\HttpKernel\",\"type\":\"->\",\"function\":\"handle\",\"file\":\"\\/opt\\/app\\/vendor\\/symfony\\/http-kernel\\/Kernel.php\",\"line\":188,\"args\":[[\"object\",\"Symfony\\\\Component\\\\HttpFoundation\\\\Request\"],[\"integer\",1],[\"boolean\",true]]},{\"namespace\":\"Symfony\\\\Component\\\\HttpKernel\",\"short_class\":\"Kernel\",\"class\":\"Symfony\\\\Component\\\\HttpKernel\\\\Kernel\",\"type\":\"->\",\"function\":\"handle\",\"file\":\"\\/opt\\/app\\/public\\/index.php\",\"line\":27,\"args\":[[\"object\",\"Symfony\\\\Component\\\\HttpFoundation\\\\Request\"]]}]}]}}\r\n```"},"comment":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/comments/484013089","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1505#issuecomment-484013089","issue_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1505","id":484013089,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4NDAxMzA4OQ==","user":{"login":"LuisCabrero","id":18163956,"node_id":"MDQ6VXNlcjE4MTYzOTU2","avatar_url":"https://avatars1.githubusercontent.com/u/18163956?v=4","gravatar_id":"","url":"https://api.github.com/users/LuisCabrero","html_url":"https://github.com/LuisCabrero","followers_url":"https://api.github.com/users/LuisCabrero/followers","following_url":"https://api.github.com/users/LuisCabrero/following{/other_user}","gists_url":"https://api.github.com/users/LuisCabrero/gists{/gist_id}","starred_url":"https://api.github.com/users/LuisCabrero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuisCabrero/subscriptions","organizations_url":"https://api.github.com/users/LuisCabrero/orgs","repos_url":"https://api.github.com/users/LuisCabrero/repos","events_url":"https://api.github.com/users/LuisCabrero/events{/privacy}","received_events_url":"https://api.github.com/users/LuisCabrero/received_events","type":"User","site_admin":false},"created_at":"2019-04-17T09:39:16Z","updated_at":"2019-04-17T09:39:16Z","author_association":"NONE","body":"Hi GuilhemN,\r\n\r\nYeah, in that Account entity I have both getter and setter for that attribute:\r\n\r\n```\r\n    /**\r\n     * @return array|null\r\n     */\r\n    public function getRevenueShare(): ?array\r\n    {\r\n        return $this->revenue_share;\r\n    }\r\n\r\n    /**\r\n     * @param array|null $revenue_share\r\n     * @return Account\r\n     */\r\n    public function setRevenueShare(?array $revenue_share): self\r\n    {\r\n        $this->revenue_share = $revenue_share;\r\n\r\n        return $this;\r\n    }\r\n```\r\n\r\nWhat kind of notation should I use to avoid this error and make `revenue_share` being interpreted as `revenueShare`?\r\n\r\nThanks a lot!"}}
{"actor":{"display_login":"LuisCabrero"}}