-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpieces.raml
144 lines (139 loc) · 4.72 KB
/
pieces.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#%RAML 1.0
title: Pieces
baseUri: https://github.com/folio-org/mod-orders
version: v1
protocols: [ HTTP, HTTPS ]
documentation:
- title: Orders Business Logic API
content: <b>API for managing pieces</b>
types:
piece: !include acq-models/mod-orders-storage/schemas/piece.json
piece-collection: !include acq-models/mod-orders-storage/schemas/piece_collection.json
errors: !include raml-util/schemas/errors.schema
UUID:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
traits:
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
validate: !include raml-util/traits/validation.raml
resourceTypes:
collection: !include rtypes/collection-with-json-response.raml
collection-item: !include rtypes/item-collection-with-json-response.raml
/orders/pieces:
displayName: Pieces
description: Create piece record
type:
collection:
exampleCollection: !include acq-models/mod-orders-storage/examples/piece_collection.sample
exampleItem: !include acq-models/mod-orders-storage/examples/piece_get.sample
schemaCollection: piece-collection
schemaItem: piece
is: [validate]
get:
is: [pageable, searchable: {description: "using CQL (indexes for piece records)", example: "format==\"Physical\""} ]
post:
description: Create piece record
queryParameters:
createItem:
displayName: Should item will be created for piece
type: boolean
description: Should item will be created for piece
example: true
required: false
default: false
/{id}:
uriParameters:
id:
description: The UUID of a piece record
type: UUID
type:
collection-item:
exampleItem: !include acq-models/mod-orders-storage/examples/piece_get.sample
schema: piece
is: [validate]
get:
description: Return a piece record with given {id}
put:
description: Update a piece record with given {id}
queryParameters:
createItem:
displayName: Should item will be created for piece
type: boolean
description: Should item will be created for piece
example: true
required: false
default: false
deleteHolding:
displayName: The associated holding should be removed
type: boolean
description: The associated holding should be removed
example: true
required: false
default: false
body:
application/json:
type: piece
example:
strict: false
value: !include acq-models/mod-orders-storage/examples/piece_get.sample
responses:
204:
description: "Piece record successfully updated"
400:
description: "Bad request"
body:
application/json:
example:
strict: false
value: !include examples/errors_400.sample
text/plain:
example: "unable to create Piece -- Bad request"
404:
description: "Request id does not exists"
body:
application/json:
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
example:
strict: false
value: !include examples/errors_500.sample
text/plain:
example: "unable to create Piece -- Internal server error, e.g. due to misconfiguration"
delete:
description: Delete a piece with given {id}
queryParameters:
deleteHolding:
displayName: The associated holding should be removed
type: boolean
description: The associated holding should be removed
example: true
required: false
default: false
responses:
204:
description: "Piece record successfully deleted"
400:
description: "Bad request"
body:
application/json:
example:
strict: false
value: !include examples/errors_400.sample
text/plain:
example: "unable to delete Piece -- Bad request"
404:
description: "Request id does not exists"
body:
application/json:
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
example:
strict: false
value: !include examples/errors_500.sample
text/plain:
example: "unable to delete Piece -- Internal server error, e.g. due to misconfiguration"