| 1 |
# https://raw.githubusercontent.com/raml2html/raml2html/master/examples/helloworld.raml |
| 2 |
# |
| 3 |
#%RAML 1.0 |
| 4 |
title: Hello world # required title |
| 5 |
version: 1 |
| 6 |
baseUri: http://example.com/{version} |
| 7 |
documentation: |
| 8 |
- title: Welcome |
| 9 |
content: | |
| 10 |
Welcome to the Example Documentation. The Example API allows you |
| 11 |
to do stuff. See also [example.com](https://www.example.com). |
| 12 |
- title: Chapter two |
| 13 |
content: | |
| 14 |
More content here. Including **bold** text! |
| 15 |
|
| 16 |
/helloworld: # optional resource |
| 17 |
description: This is the top level description for /helloworld. |
| 18 |
|
| 19 |
get: # HTTP method declaration |
| 20 |
responses: # declare a response |
| 21 |
200: # HTTP status code |
| 22 |
body: # declare content of response |
| 23 |
application/json: # media type |
| 24 |
type: | # structural definition of a response (schema or type) |
| 25 |
{ |
| 26 |
"title": "Hello world Response", |
| 27 |
"type": "object", |
| 28 |
"properties": { |
| 29 |
"message": { |
| 30 |
"type": "string" |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
example: # example how a response looks like |
| 35 |
{ |
| 36 |
"message": "Hello world" |
| 37 |
} |
| 38 |
/test: |
| 39 |
displayName: TEST |
| 40 |
get: |
| 41 |
description: a sub resource |
| 42 |
|
| 43 |
/{id}: |
| 44 |
uriParameters: |
| 45 |
id: |
| 46 |
type: string |
| 47 |
description: account identifier |
| 48 |
minLength: 1 |
| 49 |
maxLength: 10 |
| 50 |
|
| 51 |
get: |
| 52 |
headers: |
| 53 |
Authorization: |
| 54 |
type: string |
| 55 |
description: Basic authentication header |
| 56 |
example: | |
| 57 |
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
| 58 |
|
| 59 |
put: |
| 60 |
body: |
| 61 |
application/x-www-form-urlencoded: |
| 62 |
properties: |
| 63 |
name: |
| 64 |
description: name on account |
| 65 |
type: string |
| 66 |
examples: |
| 67 |
example1: Naruto Uzumaki |
| 68 |
example2: Kevin Renskers |
| 69 |
gender: |
| 70 |
enum: ["male", "female"] |