0
votes

In the mulesoft training quiz, I came across the question **

In RAML, what response type (mediaType) can RAML NOT accommodate?

** The correct answer is application/text.

To verify, I edited the RAML 0.8 spec, change the response MediaType to application/text, added few Inline text lines as the output, and simulated it. I can simulate and see the output in application/text. No errors. Why is that RAML cannot accomodate MediaType application/text ?.

3

3 Answers

0
votes

Dude you can't ask questions straight out of certification exams. Rephrase your question so that is does not include the question and answer.

Now to answer your question: RAML is for specifying RESTful APIs, IMHO you gain little by returning straight text from such an API. You can still return "text" by wrapping the text inside JSON or XML.

0
votes

The intent of the question is probably that application/text is not a valid MIME type. The question is reinforcing the fact that web services described by RAML should indicate responses (along with requests) that use standard media types. One of the attributes of a RESTful architecture is "Uniform Interface", and using standard types makes your service conform to the uniform interface of the web.

0
votes

application/text is invalid data type .Valid types in RAML are application/xml or application/json.

mediaType: [application/json]