Closed VasiliyLysokobylko closed 8 years ago
Just to comment here as well; its seems the parser has no problems with mediaType: [ application/json, application/xml ]
, but complains in any body node:
#%RAML 1.0
title: API with Types
mediaType: [ application/json, application/xml ] # no error
/users/{id}:
get:
responses:
200:
body:
description: jfkdsjhfk # error saying 'invalid media type'
changing the media type back to only one, the error disappears.
Defining a default media type has been described in RAML 0.8 as a mechanism to define the default media type returned by API responses, and expected from API requests that accept a body.
The proposal is to extend that to be able to define a list of default media types with the premise that all of them are described by exactly the same types and /or examples.
The equivalent RAML to the example above is:
If you have cases where you need to override the default behaviour, you MAY define media types explicitly when describing your API response or request. The following example illustrates that: