Regarding Multipart/mixed


We are using raml parser to generate the java interfaces. Everything is working fine except the following interfaces. We are using multipart/mixed content type to upload the multiple files (from our existing clients).

description: description
is: [protected]
schema: postFile.json
example: !include examples/postFileExample.json

Once we generate the interface for above action. The appropriate is class for multipart/mixed is not getting generated. It generating Reader class for multipart/mixed mime type (Refer the next code snippet).

FileResource.PostFilesByFileIdResponse postFilesByFileId(
String fileId,
Reader entity)
throws Exception

I have checked with other mime types “multipart/form-data”, its generating the relevant class “MimeMultipart” in java code. Can some body let me know what changes I should do for multipart/mixed mime type, so that relevant class get generated instead of Reader class? I am using mulesoft raml parser to generate the code. Anyone has achieved the same ?


So I am not really sure how these code generation tools are working, but RAML is not really mandating what mime type is supported or not. You could basically define what ever you want as RAML basically just describes the capabilities of your service. Tooling on the other hand needs to support these mime types and I am not really sure if yours does.

What are you using in particularly to generate your code?


Yes, Its nothing to do with RAML, I posted this query thinking that, if somebody has achieved the same may help us resolving our issue bit quicker. we are using mulesoft parser. we are unable to generate the code for multipart/mixed. Anyway thanks for you time.


You could raise an issue for that and see what MuleSoft is responding.