Api 在RAML中,是否有基于查询参数提供不同示例的方法
我想这个问题是不言自明的。我有一个名为Api 在RAML中,是否有基于查询参数提供不同示例的方法,api,rest,raml,Api,Rest,Raml,我想这个问题是不言自明的。我有一个名为expand的查询参数,当提供该参数时,将提供相关资源的嵌入式表示。否则,它将提供指向所述资源的链接。是否有一种方法可以基于RAML中的expand值提供这两个示例?RAML 1.0附带此支持,有关详细信息,请参阅RAML 1.0附带此支持,有关详细信息,请参阅RAML 1.0中的示例: /{songId}: get: responses: 200: body: applicat
expand
的查询参数,当提供该参数时,将提供相关资源的嵌入式表示。否则,它将提供指向所述资源的链接。是否有一种方法可以基于RAML中的expand
值提供这两个示例?RAML 1.0附带此支持,有关详细信息,请参阅RAML 1.0附带此支持,有关详细信息,请参阅RAML 1.0中的示例:
/{songId}:
get:
responses:
200:
body:
application/json:
type: object
properties:
title: string
description?: string
artist:
type: object
properties:
name: string
is_band: boolean
examples:
song1:
description: Example for a song without description and the artist is not a band.
content:
title: Yesterday
artist:
name: The Beatles
is_band: true
song2:
description: Example for a song with description and the artist is a band.
content:
title: How deep is your love
description: That could be a description for the song.
artist:
name: Calvin Harris
is_band: false
RAML 1.0中的一个示例:
/{songId}:
get:
responses:
200:
body:
application/json:
type: object
properties:
title: string
description?: string
artist:
type: object
properties:
name: string
is_band: boolean
examples:
song1:
description: Example for a song without description and the artist is not a band.
content:
title: Yesterday
artist:
name: The Beatles
is_band: true
song2:
description: Example for a song with description and the artist is a band.
content:
title: How deep is your love
description: That could be a description for the song.
artist:
name: Calvin Harris
is_band: false