define application/json and type file to multipart request
Hi,
I tried to modelling a multipart request using a part as application/json and another part as a file without success.
I am wondering if raml allows you to describe a multipart request like in OpenAPI 3 (https://swagger.io/docs/specification/describing-request-body/multipart-requests/)
Reading Multipart RFC, it allow you to define Content-Type for the parts, so I guess that would be possible using raml
Thanks
Have you seen this blog post about modeling multipart requests? Does it address your question and if not, can you share an example (even an invalid one) of what you're trying to achieve?
Yes, I have seen. Well I understood that raml 1.0 does not support at least yet something like that openapi/multipart
Another option is to use a union type to define both the fileType and its underlying JSON structure.
E.g.
#%RAML 1.0
title: My API
types:
MyFile:
type: file
fileTypes: ['application/json']
MyFileContent:
properties:
foo: integer
bar:
/resource:
post:
body:
multipart/form-data:
properties:
my_file:
type: MyFile | MyFileContent