{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/4190","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/4190/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/4190/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/4190/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/4190","id":189477044,"number":4190,"title":"[Swift] Get Status code from error","user":{"login":"jannhendrik","id":7024204,"avatar_url":"https://avatars.githubusercontent.com/u/7024204?v=3","gravatar_id":"","url":"https://api.github.com/users/jannhendrik","html_url":"https://github.com/jannhendrik","followers_url":"https://api.github.com/users/jannhendrik/followers","following_url":"https://api.github.com/users/jannhendrik/following{/other_user}","gists_url":"https://api.github.com/users/jannhendrik/gists{/gist_id}","starred_url":"https://api.github.com/users/jannhendrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jannhendrik/subscriptions","organizations_url":"https://api.github.com/users/jannhendrik/orgs","repos_url":"https://api.github.com/users/jannhendrik/repos","events_url":"https://api.github.com/users/jannhendrik/events{/privacy}","received_events_url":"https://api.github.com/users/jannhendrik/received_events","type":"User","site_admin":false},"labels":[{"id":165466244,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20Swift","name":"Client: Swift","color":"fad8c7","default":false},{"id":410530869,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/General:%20Question","name":"General: Question","color":"66ccff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.2","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13/labels","id":1928763,"number":13,"title":"v2.2.2","description":"","creator":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"open_issues":297,"closed_issues":415,"state":"open","created_at":"2016-08-08T09:16:56Z","updated_at":"2016-11-16T16:37:22Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-11-15T19:00:29Z","updated_at":"2016-11-16T17:46:41Z","closed_at":null,"body":"<!--\r\nPlease follow the issue template below for bug reports and feature requests.\r\nAlso please indicate in the issue title which language/library is concerned. Eg:  [JAVA] Bug generating foo with bar \r\n-->\r\n\r\n##### Description\r\n\r\nI wasn't able to get the status code after making a request. My approach was: \r\n\r\n```swift\r\nlet request = UserdetailcontrollerAPI.createUsingPOST2WithRequestBuilder(userInfo: userInfo);\r\n      request.execute {response, error in\r\n            if(error != nil){\r\n                let err = error as! ErrorResponse\r\n                print(err)\r\n                \r\n                switch(error!){\r\n                    case (409,_,_): print(\"409\");\r\n                }\r\n}\r\n```\r\nSince error is of type Error? I get a \"Tuple pattern cannot match values of the non-tuple type: Error\"\r\n\r\n<!-- describe what is the question, suggestion or issue and why this is a problem for you. -->\r\n\r\n##### Swagger-codegen version\r\n\r\nI am using the current master branch of swagger 2.0. (Code is generated from a spring server.)\r\n\r\n<!-- which version of swagger-codegen are you using, is it a regression? -->\r\n\r\n##### Swagger declaration file content or url\r\n\r\n<!-- if it is a bug, a json or yaml that produces it.\r\n    If you post the code inline, please wrap it with -->\r\n\r\n```yaml\r\nswagger: '2.0'\r\ninfo:\r\n  description: Api Documentation\r\n  version: '1.0'\r\n  title: Api Documentation\r\n  termsOfService: 'urn:tos'\r\n  contact: {}\r\n  license:\r\n    name: Apache 2.0\r\n    url: 'http://www.apache.org/licenses/LICENSE-2.0'\r\nhost: 'localhost:8080'\r\nbasePath: /   \r\n\r\n...\r\n ```\r\n\r\n<!--\r\n    (for JSON code), so it becomes more readable. If it is longer than about ten lines,\r\n    please create a Gist (https://gist.github.com) or upload it somewhere else and\r\n    link it here.\r\n  -->\r\n\r\n##### Command line used for generation\r\n\r\njava -jar swagger-codegen-cli.jar generate   -i project.json   -l swift3 -o ../project_swagger\r\n\r\n<!-- including the language, libraries and various options -->\r\n\r\n##### Steps to reproduce\r\n\r\n<!-- unambiguous set of steps to reproduce the bug.-->\r\n\r\n##### Related issues\r\n\r\n<!-- has a similar issue been reported before? Please do a search in https://github.com/swagger-api/swagger-codegen/issues?utf8=%E2%9C%93&q=is%3Aissue%20 -->\r\n\r\n##### Suggest a Fix\r\n\r\n<!-- if you can't fix the bug yourself, perhaps you can point to what might be\r\n  causing the problem (line of code or commit) -->\r\n\r\nI needed this immediately so I changed the type of ErrorResponse to in Models.mustache. I don't understand the idea of the original code anyhow. Maybe someone can explain it?\r\n\r\n```swift\r\npublic typealias ErrorResponse = (Int, Data?, Error?);\r\n\r\n/*\r\npublic enum ErrorResponse : Error {\r\n    case Error(Int, Data?, Error)\r\n}\r\n*/"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/261018030","html_url":"https://github.com/swagger-api/swagger-codegen/issues/4190#issuecomment-261018030","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/4190","id":261018030,"user":{"login":"jaz-ah","id":13263369,"avatar_url":"https://avatars.githubusercontent.com/u/13263369?v=3","gravatar_id":"","url":"https://api.github.com/users/jaz-ah","html_url":"https://github.com/jaz-ah","followers_url":"https://api.github.com/users/jaz-ah/followers","following_url":"https://api.github.com/users/jaz-ah/following{/other_user}","gists_url":"https://api.github.com/users/jaz-ah/gists{/gist_id}","starred_url":"https://api.github.com/users/jaz-ah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaz-ah/subscriptions","organizations_url":"https://api.github.com/users/jaz-ah/orgs","repos_url":"https://api.github.com/users/jaz-ah/repos","events_url":"https://api.github.com/users/jaz-ah/events{/privacy}","received_events_url":"https://api.github.com/users/jaz-ah/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T17:46:41Z","updated_at":"2016-11-16T17:46:41Z","body":"@jannhendrik looks like you want switch(err) not switch(error) "}}
{"actor":{"display_login":"jaz-ah"}}