{"action":"created","issue":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1241","repository_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle","labels_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1241/labels{/name}","comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1241/comments","events_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1241/events","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1241","id":300173172,"number":1241,"title":"Body Parameter as Array instead of Object","user":{"login":"ChrOst","id":7702426,"avatar_url":"https://avatars0.githubusercontent.com/u/7702426?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrOst","html_url":"https://github.com/ChrOst","followers_url":"https://api.github.com/users/ChrOst/followers","following_url":"https://api.github.com/users/ChrOst/following{/other_user}","gists_url":"https://api.github.com/users/ChrOst/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrOst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrOst/subscriptions","organizations_url":"https://api.github.com/users/ChrOst/orgs","repos_url":"https://api.github.com/users/ChrOst/repos","events_url":"https://api.github.com/users/ChrOst/events{/privacy}","received_events_url":"https://api.github.com/users/ChrOst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-26T09:57:18Z","updated_at":"2018-02-26T10:07:28Z","closed_at":null,"author_association":"NONE","body":"I'm using nelmio/api-doc-bundle ^3.0\r\nGiving the following SWG\\Parameter / SWG\\Schema construct I expected that I will have an Array as example value, instead of that I get the following:\r\n```\r\n[\r\n  {\r\n    \"name\": \"string\",\r\n    \"mac\": \"string\"\r\n  }\r\n]\r\n```\r\n\r\nWhat I expected:\r\n```\r\n{\r\n  \"name\": \"string\",\r\n  \"mac\": \"string\"\r\n}\r\n```\r\n\r\nWhat I used to build the Documentation:\r\n```\r\n     *     @SWG\\Parameter(\r\n     *         name=\"body\",\r\n     *         in=\"body\",\r\n     *         @SWG\\Schema(\r\n     *             type=\"array\",\r\n     *             @Model(type=MySymfonyBundle\\JsonInputs\\PcComputerAdd::class)\r\n     *         )\r\n     *     ),\r\n```\r\nSwapping the type=\"array\" to type=\"object\" just gives an empty array as Documentation Output.\r\nThis happens on POST, PUT, PATCH operation (actually everything where you are transmitting body).\r\n\r\nStripped down contents of MySymfonyBundle/JsonInputs/PcComputerAdd.php: \r\n```\r\nnamespace MySymfonyBundle\\JsonInputs;\r\nuse JMS\\Serializer\\Annotation\\Type;\r\nuse JMS\\Serializer\\Annotation\\SerializedName;\r\nclass PcComputerAdd {\r\n    /**\r\n    * Name of the Machine\r\n    * @Type(\"string\")\r\n    * @SerializedName(\"name\")\r\n    */\r\n    private $name;\r\n    /**\r\n    * MacAdress of the Machine\r\n    * @Type(\"string\")\r\n    * @SerializedName(\"mac\")\r\n    */\r\n    private $mac;\r\n}\r\n```\r\n\r\nWhat did I do wrong or did I hit a bug?\r\nActually the docs are a bit messy and hard to find :-("},"comment":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/comments/368450689","html_url":"https://github.com/nelmio/NelmioApiDocBundle/issues/1241#issuecomment-368450689","issue_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/1241","id":368450689,"user":{"login":"ChrOst","id":7702426,"avatar_url":"https://avatars0.githubusercontent.com/u/7702426?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrOst","html_url":"https://github.com/ChrOst","followers_url":"https://api.github.com/users/ChrOst/followers","following_url":"https://api.github.com/users/ChrOst/following{/other_user}","gists_url":"https://api.github.com/users/ChrOst/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrOst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrOst/subscriptions","organizations_url":"https://api.github.com/users/ChrOst/orgs","repos_url":"https://api.github.com/users/ChrOst/repos","events_url":"https://api.github.com/users/ChrOst/events{/privacy}","received_events_url":"https://api.github.com/users/ChrOst/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T10:07:28Z","updated_at":"2018-02-26T10:07:28Z","author_association":"NONE","body":"for reference: https://github.com/zircote/swagger-php/issues/365"}}
{"actor":{"display_login":"ChrOst"}}