I try to define raml specification for request with two parts. Below is curl example:
curl --header "Authorization: ***" -F "[email protected]" -F metadata='{"file_size":879394}' http://***/v1/media_photos
I would like something like like:
#%RAML 1.0
title: test
/media_photos:
post:
description: Send Receipt with additional information
headers:
Authorization:
description: Authorization header. Will be implemented(changed) further.
required: true
example: K7ny27JTpKVsTgdyLdDfmQQWVLERj2zAK5BslRsqyw
body:
metadata: // not valid
application/json:
properties:
file_size:
type: integer
example: 879394
required: true
photo: //not valid
multipart/form-data:
properties:
file:
description: Upload file
type: file
required: true
But it is not a valid RAML. How I can define request parts in RAML?
You simply need to put all properties under the multipart/form-data. Try this:
Another option, which may be closer to the code you provided is this: