Search code examples
jsonrestjsonschemaraml

Can you expect JSON schema compliant data from a RAML API or is it just for posting data?


I am talking to an API that uses RAML. I am both downloading and uploading data to it. When uploading data I had previously downloaded, I got a JSON Schema violation error, saying some of the parameters in the JSON objects were not allowed.

I realize the data i received is not following the JSON schema.

Is this kind of behavior a violation against the RAML principles?


Solution

  • What columns you GET and what columns you are allowed to POST may not be the same. For example, if you GET a user, it might include a user_id column, but you usually won't be allowed to write to it!

    It's difficult to give a fuller answer without seeing the RAML spec document. It's totally possible and valid to define different schemas for each HTTP method.