答案 0 :(得分:1)
您可以在RAML 0.8中拥有multiple responses,例如,一个用于200状态代码,一个用于404状态代码,等等。 一个例子是:
/media/popular:
displayName: Most Popular Media
get:
description: |
Get a list of what media is most popular at the moment.
responses:
200:
body:
application/json:
schema: !include instagram-v1-media-popular.schema.json
503:
description: |
The service is currently unavailable or you exceeded the maximum requests
per hour allowed to your application.
body:
application/json:
schema: !include instagram-v1-meta-error.schema.json
您可以指定多个requests,但每个都可以指定不同的媒体类型。 例如:
/jobs:
post:
description: Create a Job
body:
text/xml: !!null
application/json: !!null
你不能在0.8中有多个examples。 (在RAML 1中,您可以有多个示例)