RAML specification for request parts


#1

I try to define raml specification for request with two parts. Below is curl example:

curl --header "Authorization: ***" -F "photo=@flower.jpg" -F metadata='{"file_size":879394}' http://***/v1/media_photos

I would like something like like:

#%RAML 1.0
title: test

types:
  Metadata:
    type: object
    properties:
      fle_size:
        type: integer
        example: 879394
        required: true

/media_photos:
  post:
    description: Send Receipt with additional information
    headers:
      Authorization:
        description: Authorization header. 
        required: true
        example: K7ny27JTpKVsTgdyLdDfmQQWVLERj2zAK5BslRsqyw
    body:
        multipart/form-data:
          formParameters:
            metadata:
              type: Metadata
            photo:
              description: Upload file
              type: file
              required: true

But my IDE think that it is not a valid RAML. How I can define request parts in RAML?
Thanks in advance!


#2

RAML 1.0 does not use formParameters anymore, but instead you need to use properties.


#3

@Vadym_Perepeliak
Please see the attached snapshot for the error when i tried using your RAML.

As mentioned by Christian, issues is with formparameters. I replaced the formparameters with properties and issue got fixed.


#4

Hii
use properties instead of formParameters.
I think you will definately get that