-
-
Notifications
You must be signed in to change notification settings - Fork 165
/
backend-swagger-spec.yml
126 lines (126 loc) · 2.88 KB
/
backend-swagger-spec.yml
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
swagger: "2.0"
info:
version: "1.0.0"
title: "Book Box Demo Service"
contact:
email: "[email protected]"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
host: "localhost"
basePath: "/"
tags:
- name: "books"
description: "Your BookBox"
schemes:
- "http"
paths:
/books:
get:
tags:
- "books"
summary: "Get all books from the box"
operationId: "getAllBooks"
security:
- oauth2: [global]
produces:
- "application/json"
responses:
200:
description: "list of all books"
schema:
type: "array"
items:
$ref: "#/definitions/Book"
post:
tags:
- "books"
summary: "Add a new book to the box"
operationId: "addNewBook"
parameters:
- in: "body"
name: "body"
description: "Book object that needs to be added to the box"
required: true
schema:
type: "object"
properties:
title:
type: "string"
author:
type: "string"
security:
- oauth2: [global]
consumes:
- "application/json"
responses:
201:
description: "Book was created"
400:
description: "Book object format mismatch"
/books/{bookId}:
get:
tags:
- "books"
summary: "Get book by id"
operationId: "getBookById"
parameters:
- name: "bookId"
in: "path"
description: "ID of the book to return"
required: true
type: "integer"
format: "int32"
security:
- oauth2: [global]
produces:
- "application/json"
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/Book"
400:
description: "Invalid ID supplied"
404:
description: "Book not found"
delete:
tags:
- "books"
summary: "Delete book by id"
operationId: "deleteBookById"
parameters:
- name: "bookId"
in: "path"
description: "ID of the book to delete"
required: true
type: "integer"
format: "int32"
security:
- oauth2: [global]
responses:
204:
description: "Book has been successfully removed from box"
400:
description: "Invalid ID supplied"
404:
description: "Book not found"
securityDefinitions:
oauth2:
type: "oauth2"
authorizationUrl: "http://localhost:8080/auth/realms/demo/protocol/openid-connect/auth"
tokenUrl: "http://localhost:8080/auth/realms/demo/protocol/openid-connect/token"
flow: "accessCode"
scopes:
global: "global"
definitions:
Book:
type: "object"
properties:
id:
type: "integer"
format: "int32"
title:
type: "string"
author:
type: "string"