aml-converter-maven-plugin-example.0.15.source-code.music.raml Maven / Gradle / Ivy
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- halLink: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "A link",
"properties": {
"href": { "type": "string" }
}
}
- song: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "A canonical song",
"properties": {
"title": { "type": "string", "description": "The title of the Song"},
"artist": { "type": "string", "description": ["The artist.",
"",
"This is a multiline description"] },
"link": { "$ref": "halLink", "targetType": "artist" }
},
"required": [ "title", "artist" ]
}
- artist: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "A canonical song",
"properties": {
"name": { "type": "string" }
}
}
traits:
- paged:
queryParameters:
pages:
description: The number of pages to return
type: number
- secured: !include secured.yml
/songs:
is: [ paged, secured ]
get:
headers:
X-Vendor-Header:
description: a header required by the vendor
required: true
queryParameters:
genre:
description: filter the songs by genre
responses:
200:
headers:
X-Vendor-Response-Header:
description: a response header
body:
application/json:
example: |
[
{
"title" : "Rainbows and Unicorns"
}
]
post:
body:
application/json:
example: |
{
"title": "foo"
}
/{songId}:
get:
responses:
200:
description: return the song
body:
application/json:
schema: song
application/xml:
delete:
description: |
This method will *delete* an **individual song**
© 2015 - 2025 Weber Informatics LLC | Privacy Policy