I have an API where I have to pass both file and an object. The API is working properly in postman. Following image shows how I have done this in postman.
I am trying to do the same thing in stoplight. I have written the following code in yaml file.
content:
multipart/form-data:
schema:
type: object
properties:
files:
type: string
format: binary
data:
type: object
encoding:
data:
contentType: apllication/json
When I run the API in stoplight I get following error.
I have followed this link https://swagger.io/docs/specification/describing-request-body/multipart-requests/. Anyone know how can I solve this problem? Thanks!
I am guessing this is about mocking your API via Stoplight. If yes, this looks like something that Stoplight mock doesn't support yet.
Also, you don't need to specify the
contentType
if you are using the default types. One potential issue I can see is that yourdata
parameter is marked asobject
but doesn't have any properties defined.