-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWidgetType.raml
87 lines (87 loc) · 2.12 KB
/
WidgetType.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#%RAML 1.0 Library
usage: Schema for a Widget
uses:
api: jsonApiLibrary.raml
types:
widgets:
description: a widget response
type: widgets_post
properties:
id:
required: true
example:
type: widgets
id: abc-123
attributes:
name: can opener
qty: 42
relationships:
locations:
data:
- type: locations
id: "14"
- type: locations
id: "15"
links:
self: /widgets/abc-123/relationships/location
widgets_post:
description: a POSTable widget's primary (id is optional, required attributes are indicated)
type: widgets_patch
# looks like inheritance is not multi-level. This is WET!
properties:
attributes:
required: false
properties:
name:
required: true
type: string
description: catalog name
qty:
required: false
type: integer
minimum: 0
description: quantity
example:
type: widgets
attributes:
name: can opener
qty: 42
relationships:
locations:
data:
- type: locations
id: "14"
- type: locations
id: "15"
links:
self: /widgets/abc-123/relationships/locations
widgets_patch:
description: a PATCHable widget's primary data. Only supply attributes or relationships that are changed.
type: api.resource_post
properties:
attributes:
required: false
properties:
name:
required: false
type: string
description: catalog name
qty:
required: false
type: integer
minimum: 0
description: quantity
relationships:
type: api.relationships
required: false
additionalProperties: false
example:
type: widgets
id: abc-123
attributes:
qty: 42
relationships:
locations:
data:
- type: locations
id: "13"