{"action":"created","issue":{"url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/589","labels_url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/589/labels{/name}","comments_url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/589/comments","events_url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/589/events","html_url":"https://github.com/martypitt/swagger-springmvc/pull/589","id":57485385,"number":589,"title":"Add support for @RequestPart annotation ","user":{"login":"ammmze","id":203336,"avatar_url":"https://avatars.githubusercontent.com/u/203336?v=3","gravatar_id":"","url":"https://api.github.com/users/ammmze","html_url":"https://github.com/ammmze","followers_url":"https://api.github.com/users/ammmze/followers","following_url":"https://api.github.com/users/ammmze/following{/other_user}","gists_url":"https://api.github.com/users/ammmze/gists{/gist_id}","starred_url":"https://api.github.com/users/ammmze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ammmze/subscriptions","organizations_url":"https://api.github.com/users/ammmze/orgs","repos_url":"https://api.github.com/users/ammmze/repos","events_url":"https://api.github.com/users/ammmze/events{/privacy}","received_events_url":"https://api.github.com/users/ammmze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T16:43:31Z","updated_at":"2015-02-12T22:18:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/martypitt/swagger-springmvc/pulls/589","html_url":"https://github.com/martypitt/swagger-springmvc/pull/589","diff_url":"https://github.com/martypitt/swagger-springmvc/pull/589.diff","patch_url":"https://github.com/martypitt/swagger-springmvc/pull/589.patch"},"body":"Add support for `@RequestPart` annotation which means the request content-type would be multipart/form-data, which must have paramType of 'form' in swagger-ui.\r\n\r\nThis is for Issue #588\r\n\r\nSome caveats I've found when using `@RequestPart` on things other than files...\r\n\r\n* Currently swagger-ui renders paramType 'form' as `<input type=\"text\" />` instead of `<textarea>`. I plan to submit a pull request to fix that as well.\r\n* Through swagger-ui, the content-type for the `@RequestPart`'s that aren't files are not set (limitation of HTML forms), so in order for spring to properly handle a request with a `@RequestPart` that isn't a file, I had to use a custom MultipartResolver to detect if the content type should be `application/json` if it was null.\r\n"},"comment":{"url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/comments/74165535","html_url":"https://github.com/martypitt/swagger-springmvc/pull/589#issuecomment-74165535","issue_url":"https://api.github.com/repos/martypitt/swagger-springmvc/issues/589","id":74165535,"user":{"login":"ammmze","id":203336,"avatar_url":"https://avatars.githubusercontent.com/u/203336?v=3","gravatar_id":"","url":"https://api.github.com/users/ammmze","html_url":"https://github.com/ammmze","followers_url":"https://api.github.com/users/ammmze/followers","following_url":"https://api.github.com/users/ammmze/following{/other_user}","gists_url":"https://api.github.com/users/ammmze/gists{/gist_id}","starred_url":"https://api.github.com/users/ammmze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ammmze/subscriptions","organizations_url":"https://api.github.com/users/ammmze/orgs","repos_url":"https://api.github.com/users/ammmze/repos","events_url":"https://api.github.com/users/ammmze/events{/privacy}","received_events_url":"https://api.github.com/users/ammmze/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T22:18:44Z","updated_at":"2015-02-12T22:18:44Z","body":"@dilipkrish, It would hand it off to the message converter if the Content-Type for the boundary was set, however a Content-Type is not set at all (unless its a file).\r\n\r\nExample request:\r\n```\r\n{other headers}\r\nContent-Type:multipart/form-data; boundary=----WebKitFormBoundarydGA65oLFZj9mGBg5\r\n{other headers}\r\n\r\n------WebKitFormBoundarydGA65oLFZj9mGBg5\r\nContent-Disposition: form-data; name=\"parameter1\"\r\n\r\n{}\r\n------WebKitFormBoundarydGA65oLFZj9mGBg5\r\nContent-Disposition: form-data; name=\"parameter2\"; filename=\"example logo 800x600_382_blogImage_jpg_l.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundarydGA65oLFZj9mGBg5--\r\n```\r\n\r\nCurrently in swagger-ui I do not see any way that you can specify the Content-Type for a specific parameter/boundary. And yes, the parameter type must be 'form' (or in swagger 2.0 it should actually be 'formData' apparently). Setting the parameter type to 'form' is one of the goals of this pull request. Without this change, the generated spec produces `parameter1` as `body` and `parameter2` as `form` and when the request is sent, only `parameter2` is in the payload.\r\n\r\n"}}