-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathopenapi.yaml
156 lines (154 loc) · 3.64 KB
/
openapi.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
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
145
146
147
148
149
150
151
152
153
154
155
156
openapi: 3.0.3
info:
title: Choreo Sample - Book List - Nodejs REST API Service
description: >-
This is a sample API specification for a simple reading list application with in-memory cache
written in Nodejs
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
externalDocs:
description: Choreo
url: https://choreo.dev
servers:
- url: http://localhost:8080
tags:
- name: books
description: In-memory book list cache API
paths:
/books:
summary: List all books
get:
summary: List all books
operationId: ListAllBooks
tags:
- books
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/StringArray"
post:
summary: Insert a new book
operationId: SetNewBook
responses:
"200":
description: Successful operation
"400":
description: Invalid request body
tags:
- books
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/KeyValue"
/books/{uuid}:
summary: Get book by UUID
get:
tags:
- books
summary: Get book by UUID
operationId: GetBookByUUID
parameters:
- name: uuid
in: path
description: UUID of book to return
required: true
schema:
type: string
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/KeyValue"
"404":
description: UUID not found
delete:
tags:
- books
summary: Delete book by UUID
description: Deletes a single book based on the UUID supplied
operationId: DeleteBookByUUID
parameters:
- name: uuid
in: path
description: UUID of book to delete
required: true
schema:
type: string
responses:
"200":
description: Successful operation
"404":
description: ISBN not found
put:
tags:
- books
summary: Update book status by UUID
description: Updates the status of the book based on the UUID supplied
operationId: UpdateBookStatusByUUID
parameters:
- name: uuid
in: path
description: UUID of book to update
required: true
schema:
type: string
responses:
"200":
description: Successful operation
"404":
description: UUID not found
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
/healthz:
summary: Healthcheck endpoint
get:
summary: Healthcheck
operationId: Healthcheck
responses:
"200":
description: Healthy response
components:
schemas:
Key:
type: object
properties:
uuid:
type: string
example: "my-uuid"
Status:
type: object
properties:
status:
type: string
example: "read"
KeyValue:
type: object
required:
- title
- author
- status
properties:
title:
type: string
example: "my-title"
author:
type: string
example: "my-author"
status:
type: string
example: "read"
StringArray:
type: array
items:
type: string