{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/222","labels_url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/222/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/222/events","html_url":"https://github.com/swagger-api/swagger-spec/issues/222","id":50654272,"number":222,"title":"Allow different Content Types in File type parameters","user":{"login":"thorntech","id":770810,"avatar_url":"https://avatars.githubusercontent.com/u/770810?v=3","gravatar_id":"","url":"https://api.github.com/users/thorntech","html_url":"https://github.com/thorntech","followers_url":"https://api.github.com/users/thorntech/followers","following_url":"https://api.github.com/users/thorntech/following{/other_user}","gists_url":"https://api.github.com/users/thorntech/gists{/gist_id}","starred_url":"https://api.github.com/users/thorntech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thorntech/subscriptions","organizations_url":"https://api.github.com/users/thorntech/orgs","repos_url":"https://api.github.com/users/thorntech/repos","events_url":"https://api.github.com/users/thorntech/events{/privacy}","received_events_url":"https://api.github.com/users/thorntech/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-spec/labels/Swagger.Next%20Proposal","name":"Swagger.Next Proposal","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-02T14:07:17Z","updated_at":"2015-10-14T09:03:13Z","closed_at":null,"body":"For multipart uploads that contain a file and some other part, like a JSON object, it would be very useful to be able to specify a content type on the File parts other than the actual binary file. This is critical for Java applications that need the content type of the part in order to know how to deserialize the json or xml into a Java object. \r\n\r\nFor what its worth, I was able to get this working by modifying swagger-ui,js to use a Blob as the FormData. I had to add a \"contentType\" field to the Parameter object. I know this violates the spec, but this worked for my project. \r\n\r\nswagger-ui.js line 1797:\r\n\r\n    if (param.paramType === 'form') {\r\n          if (param.type.toLowerCase() !== 'file' && map[param.name] !== void 0) {\r\n        \tif(typeof param.contentType !== 'undefined') {\r\n        \t\tbodyParam.append(param.name, new Blob([map[param.name]], { type: param.contentType}));\r\n        \t}\r\n        \telse {\r\n        \t\tbodyParam.append(param.name, map[param.name]);\r\n        \t}\r\n          }\r\n        }\r\n\r\nIn the swagger doc, I can define the file and the json object parameters like so: \r\n\r\n            {\r\n\t         \"name\": \"story\",\r\n\t         \"description\": \"The story object in json format\",\r\n\t         \"required\": true,\r\n\t         \"paramType\": \"form\",\r\n\t         \"type\": \"Story\",\r\n\t         \"contentType\": \"application/json\"\r\n\t        },\r\n\t      \t{\r\n\t         \"name\": \"file\",\r\n\t         \"description\": \"The base64 encoded multipart file attachment. \",\t         \r\n\t         \"required\": true,\r\n\t         \"paramType\": \"form\",\r\n\t         \"type\": \"File\"\r\n\t        }\r\n\r\nRefer to this discussion / issue in swagger-core for more detail - https://github.com/swagger-api/swagger-core/issues/636"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/comments/147983508","html_url":"https://github.com/swagger-api/swagger-spec/issues/222#issuecomment-147983508","issue_url":"https://api.github.com/repos/swagger-api/swagger-spec/issues/222","id":147983508,"user":{"login":"christopheblin","id":11044877,"avatar_url":"https://avatars.githubusercontent.com/u/11044877?v=3","gravatar_id":"","url":"https://api.github.com/users/christopheblin","html_url":"https://github.com/christopheblin","followers_url":"https://api.github.com/users/christopheblin/followers","following_url":"https://api.github.com/users/christopheblin/following{/other_user}","gists_url":"https://api.github.com/users/christopheblin/gists{/gist_id}","starred_url":"https://api.github.com/users/christopheblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopheblin/subscriptions","organizations_url":"https://api.github.com/users/christopheblin/orgs","repos_url":"https://api.github.com/users/christopheblin/repos","events_url":"https://api.github.com/users/christopheblin/events{/privacy}","received_events_url":"https://api.github.com/users/christopheblin/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T09:03:13Z","updated_at":"2015-10-14T09:03:13Z","body":"> I'll just add and say that for now vendor extensions can be used to extend this functionality\r\n\r\nCould you elaborate on this please.\r\nI'm having the same problem but I have no clue what you mean with this sentence..."}}