{"action":"created","issue":{"url":"https://api.github.com/repos/Moya/Moya/issues/358","labels_url":"https://api.github.com/repos/Moya/Moya/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/Moya/Moya/issues/358/comments","events_url":"https://api.github.com/repos/Moya/Moya/issues/358/events","html_url":"https://github.com/Moya/Moya/issues/358","id":123968628,"number":358,"title":"Optional parameters","user":{"login":"Skornos","id":2428729,"avatar_url":"https://avatars.githubusercontent.com/u/2428729?v=3","gravatar_id":"","url":"https://api.github.com/users/Skornos","html_url":"https://github.com/Skornos","followers_url":"https://api.github.com/users/Skornos/followers","following_url":"https://api.github.com/users/Skornos/following{/other_user}","gists_url":"https://api.github.com/users/Skornos/gists{/gist_id}","starred_url":"https://api.github.com/users/Skornos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skornos/subscriptions","organizations_url":"https://api.github.com/users/Skornos/orgs","repos_url":"https://api.github.com/users/Skornos/repos","events_url":"https://api.github.com/users/Skornos/events{/privacy}","received_events_url":"https://api.github.com/users/Skornos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-27T08:47:00Z","updated_at":"2016-01-18T08:56:16Z","closed_at":null,"body":"I have a couple of endpoints with optional parameters specified like this\r\n\r\n```\r\npublic enum MyAPI {\r\n    ...\r\n    case Content(Int, Int?, String?)\r\n    ...\r\n}\r\n```\r\n\r\nThe problem is that `public var parameters` expects a type `[String: AnyObject]?` so if I pass optional value I have to unwrap it with `!` operator which causes Exception if the parameter is `nil`.\r\n\r\nI was thinking about filtering all the params from the dictionary where the value is `nil` or is there any other way? Like for example specifying `parameters` as `[String: AnyObject?]?`\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/Moya/Moya/issues/comments/172467269","html_url":"https://github.com/Moya/Moya/issues/358#issuecomment-172467269","issue_url":"https://api.github.com/repos/Moya/Moya/issues/358","id":172467269,"user":{"login":"jasl","id":1024162,"avatar_url":"https://avatars.githubusercontent.com/u/1024162?v=3","gravatar_id":"","url":"https://api.github.com/users/jasl","html_url":"https://github.com/jasl","followers_url":"https://api.github.com/users/jasl/followers","following_url":"https://api.github.com/users/jasl/following{/other_user}","gists_url":"https://api.github.com/users/jasl/gists{/gist_id}","starred_url":"https://api.github.com/users/jasl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasl/subscriptions","organizations_url":"https://api.github.com/users/jasl/orgs","repos_url":"https://api.github.com/users/jasl/repos","events_url":"https://api.github.com/users/jasl/events{/privacy}","received_events_url":"https://api.github.com/users/jasl/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T08:56:16Z","updated_at":"2016-01-18T08:56:16Z","body":"Besides, when the APIs growth big (consider we have hundreds endpoints), organize them by enums seem to be difficult.\r\n\r\nFor example:\r\n<https://github.com/artsy/eidolon/blob/master/Kiosk/App/Networking/ArtsyAPI.swift>\r\nWe need `switch ... case` on every properties, just for `path` we have 55 lines in <https://github.com/artsy/eidolon/blob/master/Kiosk/App/Networking/ArtsyAPI.swift#L51-L106>, and if I ask you: what `path` is the `AuctionListings` used for? how would you do?\r\n\r\nThere is a more important: no any check when I missing a case"}}