-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpo-number.raml
65 lines (59 loc) · 1.88 KB
/
po-number.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
#%RAML 1.0
title: PO Number
baseUri: https://github.com/folio-org/mod-orders
version: v1
protocols: [ HTTP, HTTPS ]
documentation:
- title: Orders Business Logic API
content: <b>API for managing PO numbers</b>
types:
po-number: !include acq-models/mod-orders/schemas/po_number.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:
validate: !include raml-util/traits/validation.raml
resourceTypes:
/orders/po-number:
displayName: Purchase Order Number
description: Manage purchase order (PO) number
get:
description: Get generated PO number
is: [validate]
responses:
200:
body:
application/json:
type: po-number
example:
strict: false
value: !include acq-models/mod-orders/examples/po_number_get.sample
/validate:
displayName: PO Number Validation
post:
description: validate if the PO Number is unique and matches the pattern specified
is: [validate]
body:
application/json:
type: po-number
example:
strict: false
value: !include acq-models/mod-orders/examples/po_number_get.sample
responses:
204:
description: "Valid PO Number"
400:
description: "Bad request, e.g. existing PO Number. Details of the error provided in the response."
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample