PUT request body


#1

Hi Team,

I have a REST service, to upload a file. I written RAML template for this. But test case failing with
java.lang.AssertionError:
Expected: To be empty
but:
Request violations:

  • Resource ‘//test/v1/naga/path/nata.txt’ is not defined

Here is my RAMl file

#%RAML 0.8
---
title: Hello world REST API
baseUri: http://localhost:8089/
version: v1

/test/v1/naga/path/naga.txt:
  put:
    responses:
      400:
        body:

How can i mention PUT request body type in RAML template?

Regards,
Giri


#2

same as you would for a post.

put:
  displayName: ..
  description: ...
  body:
    application/json:
      schema: ...
      example: ...

#3

This is correct … PUT works as same as POST taking payload in body … so it can be used in the same way as POST is designed in RAML templates …
RAML specification can make it more clear : - https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md
and some more link here : - http://raml.org/developers/raml-100-tutorial