-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbooks-1.0.yaml
117 lines (116 loc) · 2.85 KB
/
books-1.0.yaml
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
openapi: 3.0.0
info:
title: Tenant API
version: v2
paths:
/books:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
post:
description: Create book
operationId: postBook
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/book"
required: true
responses:
"204":
description: Book created
"400":
$ref: "#/components/responses/trait_400"
"413":
$ref: "#/components/responses/trait_413"
"500":
$ref: "#/components/responses/trait_500"
get:
description: Get books
operationId: getBooks
parameters:
- in: query
name: query
required: false
description: CQL
schema:
type: string
responses:
"200":
description: Books returned
content:
application/json:
schema:
$ref: "#/components/schemas/books"
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
/books/{id}:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- in: path
name: id
required: true
description: book identifier
schema:
type: string
format: uuid
get:
operationId: getBook
description: Get book
responses:
"200":
description: Books returned
content:
application/json:
schema:
$ref: "#/components/schemas/book"
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
components:
responses:
trait_400:
description: Bad request
content:
text/plain:
schema:
type: string
example: Invalid JSON in request
application/json:
schema:
type: object
example: {"error":"Invalid JSON in request"}
trait_404:
description: Bad request
content:
text/plain:
schema:
type: string
example: Not found
trait_413:
description: Payload Too Large
content:
text/plain:
schema:
type: string
example: Payload Too Large
trait_500:
description: Internal error
content:
text/plain:
schema:
type: string
example: Internal server error, contact administrator
schemas:
books:
$ref: schemas/books.json
book:
$ref: schemas/book.json