1+ # %RAML 1.0
2+ title : API for REST Services used in the RAML tutorials on Baeldung.com
3+ documentation :
4+ - title : Overview
5+ - content : |
6+ This document defines the interface for the REST services
7+ used in the popular RAML Tutorial series at Baeldung.com.
8+ - title : Disclaimer:
9+ - content : |
10+ All names used in this definition are purely fictional.
11+ Any similarities between the names used in this tutorial and those of real persons, whether living or dead, are merely coincidental.
12+ - title : Copyright
13+ - content : Copyright 2016 by Baeldung.com. All rights reserved.
14+ version : v1
15+ protocols : [ HTTPS ]
16+ baseUri : http://rest-api.baeldung.com/api/{version}
17+ mediaType : application/json
18+ securedBy : basicAuth
19+ securitySchemes :
20+ - basicAuth :
21+ description : Each request must contain the headers necessary for
22+ basic authentication
23+ type : Basic Authentication
24+ describedBy :
25+ headers :
26+ Authorization :
27+ description : |
28+ Used to send the Base64 encoded "username:password"
29+ credentials
30+ type : string
31+ responses :
32+ 401 :
33+ description : |
34+ Unauthorized. Either the provided username and password
35+ combination is invalid, or the user is not allowed to
36+ access the content provided by the requested URL.
37+ types :
38+ Foo : !include types/Foo.raml
39+ Bar : !include types/Bar.raml
40+ Error : !include types/Error.raml
41+ resourceTypes :
42+ - collection :
43+ usage : Use this resourceType to represent a collection of items
44+ description : A collection of <<resourcePathName|!uppercamelcase>>
45+ get :
46+ description : |
47+ Get all <<resourcePathName|!uppercamelcase>>,
48+ optionally filtered
49+ is : [ hasResponseCollection ]
50+ post :
51+ description : |
52+ Create a new <<resourcePathName|!uppercamelcase|!singularize>>
53+ is : [ hasRequestItem ]
54+ - item :
55+ usage : Use this resourceType to represent any single item
56+ description : A single <<typeName>>
57+ get :
58+ description : Get a <<typeName>> by <<resourcePathName>>
59+ is : [ hasResponseItem, hasNotFound ]
60+ put :
61+ description : Update a <<typeName>> by <<resourcePathName>>
62+ is : [ hasRequestItem, hasResponseItem, hasNotFound ]
63+ delete :
64+ description : Delete a <<typeName>> by <<resourcePathName>>
65+ is : [ hasNotFound ]
66+ responses :
67+ 204 :
68+ traits :
69+ - hasRequestItem :
70+ body :
71+ application/json :
72+ type : <<typeName>>
73+ - hasResponseItem :
74+ responses :
75+ 200 :
76+ body :
77+ application/json :
78+ type : <<typeName>>
79+ example : !include examples/<<typeName>>.json
80+ - hasResponseCollection :
81+ responses :
82+ 200 :
83+ body :
84+ application/json :
85+ type : <<typeName>>[]
86+ example : !include examples/<<typeName|!pluralize>>.json
87+ - hasNotFound :
88+ responses :
89+ 404 :
90+ body :
91+ application/json :
92+ type : Error
93+ example : !include examples/Error.json
94+ /foos :
95+ type : collection
96+ typeName : Foo
97+ get :
98+ queryParameters :
99+ name? : string
100+ ownerName? : string
101+ /{fooId} :
102+ type : item
103+ typeName : Foo
104+ /name/{name} :
105+ get :
106+ description : List all foos with a certain name
107+ typeName : Foo
108+ is : [ hasResponseCollection ]
109+ /bars :
110+ type : collection
111+ typeName : Bar
112+ /{barId} :
113+ type : item
114+ typeName : Bar
115+ /fooId/{fooId} :
116+ get :
117+ description : Get all bars for the matching fooId
118+ typeName : Bar
119+ is : [ hasResponseCollection ]
0 commit comments