-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.raml
68 lines (63 loc) · 2.31 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#%RAML 1.0
title: American Flights System API
securitySchemes:
basicAuth:
description: Need to provide Client ID and Client Secret obtained from the Anypoint Platform
type: Basic Authentication
types:
AmericanFlight: !include types/AmericanFlightDataType.raml
traits:
errorTraits: !include traits/ErrorTraits.raml
securedBy: [basicAuth]
/flights:
description: Resource **/flights** represents a collection of flights.
get:
description: Retrieve a list of flights based on optional query parameters.
is: [errorTraits]
queryParameters:
destination:
description: Filter flights by destination
required: false
enum: ['SFO', 'LAX', 'CLE']
responses:
200:
body:
application/json:
type: AmericanFlight[]
examples:
output: !include examples/AmericanFlightsExample.raml
post:
description: Create a new flight.
is: [errorTraits]
body:
application/json:
type: AmericanFlight
examples:
input: !include examples/AmericanFlightNoIDExample.raml
responses:
201:
body:
application/json:
example:
message: Flight successfully created
/{ID}:
description: Resource **/flights/{ID}** represents an individual flight identified by its unique ID.
get:
description: Retrieve details for a specific flight identified by the provided ID.
is: [errorTraits]
responses:
200:
body:
application/json:
type: AmericanFlight
examples:
output: !include examples/AmericanFlightExample.raml
delete:
description: Delete specific flight identified by the provided ID,
is: [errorTraits]
responses:
200:
body:
application/json:
example:
message: Flight successfully deleted