{"action":"created","issue":{"url":"https://api.github.com/repos/zalando/connexion/issues/66","labels_url":"https://api.github.com/repos/zalando/connexion/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/zalando/connexion/issues/66/comments","events_url":"https://api.github.com/repos/zalando/connexion/issues/66/events","html_url":"https://github.com/zalando/connexion/issues/66","id":108313269,"number":66,"title":"List as body parameter fails in validation","user":{"login":"cansik","id":5220162,"avatar_url":"https://avatars.githubusercontent.com/u/5220162?v=3","gravatar_id":"","url":"https://api.github.com/users/cansik","html_url":"https://github.com/cansik","followers_url":"https://api.github.com/users/cansik/followers","following_url":"https://api.github.com/users/cansik/following{/other_user}","gists_url":"https://api.github.com/users/cansik/gists{/gist_id}","starred_url":"https://api.github.com/users/cansik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cansik/subscriptions","organizations_url":"https://api.github.com/users/cansik/orgs","repos_url":"https://api.github.com/users/cansik/repos","events_url":"https://api.github.com/users/cansik/events{/privacy}","received_events_url":"https://api.github.com/users/cansik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zalando/connexion/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jmcs","id":3719966,"avatar_url":"https://avatars.githubusercontent.com/u/3719966?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcs","html_url":"https://github.com/jmcs","followers_url":"https://api.github.com/users/jmcs/followers","following_url":"https://api.github.com/users/jmcs/following{/other_user}","gists_url":"https://api.github.com/users/jmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcs/subscriptions","organizations_url":"https://api.github.com/users/jmcs/orgs","repos_url":"https://api.github.com/users/jmcs/repos","events_url":"https://api.github.com/users/jmcs/events{/privacy}","received_events_url":"https://api.github.com/users/jmcs/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-09-25T12:12:41Z","updated_at":"2015-09-28T14:12:57Z","closed_at":null,"body":"As I saw you modified body parameter handling in version 0.10.2 #59. Now the problem is that lists cause an error because you try to call `items` on a `list` object which fails.\r\n\r\nIt looks like you just handle dicts (JSON Objects) as body parameters ([code](https://github.com/zalando/connexion/blob/9593e9e4611d9d434f00d7057b4e5f2de4308273/connexion/decorators/parameter.py#L57)):\r\n\r\n```python\r\n        # Add body parameters\r\n        for key, value in body_parameters.items():\r\n            if key not in arguments:\r\n                logger.debug(\"Body parameter '%s' not in function arguments\", key)\r\n```\r\n\r\nMy swagger config for this route looks like this:\r\n\r\n```yaml\r\n  /provenance/:\r\n    post:\r\n      tags:\r\n        - INGEST\r\n      description: creates a new provenance if it does not exist\r\n      operationId: propertyservice.routes.provenance.create\r\n      parameters:\r\n        - name: provenance_data\r\n          in: body\r\n          description: provenance_data\r\n          required: true\r\n          schema:\r\n            type: array\r\n            items:\r\n              type: string\r\n      responses:\r\n        200:\r\n          description: OK\r\n```\r\n\r\nAnd this is what I send with the POST request as body:\r\n\r\n```json\r\n[\"test2\"]\r\n```\r\n\r\n#### Full error message\r\n```python\r\nINFO:werkzeug:127.0.0.1 - - [25/Sep/2015 13:52:47] \"POST /provenance/ HTTP/1.1\" 500 -\r\nTraceback (most recent call last):\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1836, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1820, in wsgi_app\r\n    response = self.make_response(self.handle_exception(e))\r\n  File \"/Library/Python/2.7/site-packages/flask_cors/extension.py\", line 110, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1403, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1817, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1477, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/Library/Python/2.7/site-packages/flask_cors/extension.py\", line 110, in wrapped_function\r\n    return cors_after_request(app.make_response(f(*args, **kwargs)))\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1381, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1475, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/Library/Python/2.7/site-packages/flask/app.py\", line 1461, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/Library/Python/2.7/site-packages/connexion/decorators/validation.py\", line 160, in wrapper\r\n    response = function(*args, **kwargs)\r\n  File \"/Library/Python/2.7/site-packages/connexion/decorators/validation.py\", line 271, in wrapper\r\n    response = function(*args, **kwargs)\r\n  File \"/Library/Python/2.7/site-packages/connexion/decorators/produces.py\", line 120, in wrapper\r\n    data, status_code = self.get_data_status_code(function(*args, **kwargs))\r\n  File \"/Library/Python/2.7/site-packages/connexion/decorators/parameter.py\", line 57, in wrapper\r\n    for key, value in body_parameters.items():\r\nAttributeError: 'list' object has no attribute 'items'\r\n```"},"comment":{"url":"https://api.github.com/repos/zalando/connexion/issues/comments/143753901","html_url":"https://github.com/zalando/connexion/issues/66#issuecomment-143753901","issue_url":"https://api.github.com/repos/zalando/connexion/issues/66","id":143753901,"user":{"login":"jmcs","id":3719966,"avatar_url":"https://avatars.githubusercontent.com/u/3719966?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcs","html_url":"https://github.com/jmcs","followers_url":"https://api.github.com/users/jmcs/followers","following_url":"https://api.github.com/users/jmcs/following{/other_user}","gists_url":"https://api.github.com/users/jmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcs/subscriptions","organizations_url":"https://api.github.com/users/jmcs/orgs","repos_url":"https://api.github.com/users/jmcs/repos","events_url":"https://api.github.com/users/jmcs/events{/privacy}","received_events_url":"https://api.github.com/users/jmcs/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T14:12:57Z","updated_at":"2015-09-28T14:12:57Z","body":"Fixed by #68"}}