{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3786","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3786/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3786/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3786/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3786","id":176611141,"number":3786,"title":"[Python] Flask server Swagger validation fails for GET and type file","user":{"login":"etsardou","id":5663091,"avatar_url":"https://avatars.githubusercontent.com/u/5663091?v=3","gravatar_id":"","url":"https://api.github.com/users/etsardou","html_url":"https://github.com/etsardou","followers_url":"https://api.github.com/users/etsardou/followers","following_url":"https://api.github.com/users/etsardou/following{/other_user}","gists_url":"https://api.github.com/users/etsardou/gists{/gist_id}","starred_url":"https://api.github.com/users/etsardou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsardou/subscriptions","organizations_url":"https://api.github.com/users/etsardou/orgs","repos_url":"https://api.github.com/users/etsardou/repos","events_url":"https://api.github.com/users/etsardou/events{/privacy}","received_events_url":"https://api.github.com/users/etsardou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Issue:%20Bug","name":"Issue: Bug","color":"e11d21"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Server:%20Python","name":"Server: Python","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/5","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/Future","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/5/labels","id":913962,"number":5,"title":"Future","description":"","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":141,"closed_issues":63,"state":"open","created_at":"2014-12-24T05:48:44Z","updated_at":"2016-10-02T16:53:49Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-09-13T11:02:21Z","updated_at":"2016-10-03T06:56:25Z","closed_at":null,"body":"##### Description\r\n\r\nI'm trying to implement a GET call which returns a file from the server using Swagger 2.0 specifications and python-flask server autogeneration from the Swagger online service (https://generator.swagger.io/#/). My swagger specifications are valid Swagger 2.0 as can be checked from the swagger editor (http://editor.swagger.io/#/) and the Python Flask server code is auto-generated successfully, but upon launch a validation error arises.\r\n\r\n##### Swagger-codegen version\r\n\r\nThe online version https://generator.swagger.io/#/\r\n\r\n##### Swagger declaration file content or url\r\n\r\nThe specifications follow:\r\n\r\n```\r\nswagger: '2.0'\r\ninfo:\r\n  version: \"0.0.0\"\r\n  title: Test\r\npaths:\r\n  /file/{id}:\r\n    get:\r\n      description: Returns a specific file from the server\r\n      parameters:\r\n        - name: id\r\n          in: path\r\n          description: The file to be transferred\r\n          required: true\r\n          type: integer\r\n      produces:\r\n        - 'multipart/form-data'\r\n      consumes:\r\n        - 'application/json'\r\n      responses:\r\n        200:\r\n          description: Successful response\r\n          schema:\r\n            type: file\r\n```\r\n, the python-flask server is successfully generated, but upon launch I get the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"app.py\", line 7, in <module>\r\n    app.add_api('swagger.yaml', arguments={'title': 'No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)'})\r\n  File \"/usr/local/lib/python2.7/dist-packages/connexion/app.py\", line 149, in add_api\r\n    debug=self.debug)\r\n  File \"/usr/local/lib/python2.7/dist-packages/connexion/api.py\", line 107, in __init__\r\n    validate_spec(spec)\r\n  File \"/usr/local/lib/python2.7/dist-packages/swagger_spec_validator/validator20.py\", line 82, in validate_spec\r\n    http_handlers=http_handlers)\r\n  File \"/usr/local/lib/python2.7/dist-packages/swagger_spec_validator/common.py\", line 22, in wrapper\r\n    sys.exc_info()[2])\r\n  File \"/usr/local/lib/python2.7/dist-packages/swagger_spec_validator/common.py\", line 17, in wrapper\r\n    return method(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/swagger_spec_validator/validator20.py\", line 125, in validate_json\r\n    cls=Draft4Validator)\r\n  File \"/usr/local/lib/python2.7/dist-packages/swagger_spec_validator/ref_validators.py\", line 34, in validate\r\n    instance_cls(schema, *args, **kwargs).validate(instance)\r\n  File \"/usr/local/lib/python2.7/dist-packages/jsonschema/validators.py\", line 123, in validate\r\n    raise error\r\nswagger_spec_validator.common.SwaggerValidationError: {'description': 'Successful response', 'schema': {'type': 'file'}} is not valid under any of the given schemas\r\n\r\nFailed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^/']['properties']['get']['properties']['responses']['patternProperties']['^([0-9]{3})$|^(default)$']:\r\n    {'oneOf': [{'$ref': '#/definitions/response'},\r\n               {'$ref': '#/definitions/jsonReference'}]}\r\n\r\nOn instance['paths']['/file/{id}']['get']['responses']['200']:\r\n    {'description': 'Successful response', 'schema': {'type': 'file'}}\r\nmake: *** [server-launch-python] Error 1\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/251038850","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3786#issuecomment-251038850","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3786","id":251038850,"user":{"login":"etsardou","id":5663091,"avatar_url":"https://avatars.githubusercontent.com/u/5663091?v=3","gravatar_id":"","url":"https://api.github.com/users/etsardou","html_url":"https://github.com/etsardou","followers_url":"https://api.github.com/users/etsardou/followers","following_url":"https://api.github.com/users/etsardou/following{/other_user}","gists_url":"https://api.github.com/users/etsardou/gists{/gist_id}","starred_url":"https://api.github.com/users/etsardou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsardou/subscriptions","organizations_url":"https://api.github.com/users/etsardou/orgs","repos_url":"https://api.github.com/users/etsardou/repos","events_url":"https://api.github.com/users/etsardou/events{/privacy}","received_events_url":"https://api.github.com/users/etsardou/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T06:56:25Z","updated_at":"2016-10-03T06:56:25Z","body":"Ok great, thnx!"}}
{"actor":{"display_login":"etsardou"}}