nidi3 / raml-tester

Test if a request/response matches a given raml definition
Apache License 2.0
71 stars 14 forks source link

Allow schema in POST/PUT body #12

Closed rufer7 closed 10 years ago

rufer7 commented 10 years ago

I tried today the newest version of raml-tester. While running tests I got an exception for all tests, which test POST/PUT endpoints:

No schema allowed on action(PUT /url/toEndpoint/{Id}) mime-type('application/json'), No formParameters given on action(PUT /url/toEndpoint/{Id}) mime-type('application/json')], responseViolations=[]}

According RAML spec 0.8 it should be possible to define schemas in request body like this:

post:
  body:
    application/json:
      schema: |
        {
          "$ref":"schemas/<<resourcePathName | !singularize>>.json"
        }
nidi3 commented 10 years ago

Absolutely right, a check was missing for mime-types "multipart/form-data" and "application/x-www-form-urlencoded". Only in this case no schema is allowed.

rufer7 commented 10 years ago

Thx for fixing that. When do you think next release will be done?