-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.yml
More file actions
179 lines (179 loc) · 5.19 KB
/
openapi.yml
File metadata and controls
179 lines (179 loc) · 5.19 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
openapi: '3.0.2'
info:
title: 🌱 API Seed
description: The seed from which you grow your project.
version: '1.0'
paths:
/greetings:
get:
summary: List all greetings.
tags:
- "Greetings"
responses:
'200':
$ref: '#components/responses/GreetingsList'
post:
summary: Create greetings.
tags:
- "Greetings"
requestBody:
$ref: '#/components/requestBodies/CreateGreeting'
responses:
'201':
$ref: '#components/responses/GreetingCreated'
/greetings/{greetingId}:
get:
summary: Get greeting details.
tags:
- "Greetings"
parameters:
- $ref: '#/components/parameters/GreetingId'
responses:
'200':
$ref: '#components/responses/GreetingDetails'
'404':
$ref: '#components/responses/GreetingNotFound'
put:
summary: Update greeting message.
tags:
- "Greetings"
parameters:
- $ref: '#/components/parameters/GreetingId'
requestBody:
$ref: '#/components/requestBodies/UpdateGreeting'
responses:
'200':
$ref: '#components/responses/GreetingDetails'
'404':
$ref: '#components/responses/GreetingNotFound'
delete:
summary: Delete greeting.
tags:
- "Greetings"
parameters:
- $ref: '#/components/parameters/GreetingId'
responses:
'204':
$ref: '#components/responses/GreetingDeleted'
'404':
$ref: '#components/responses/GreetingNotFound'
components:
parameters:
GreetingId:
in: path
name: greetingId
schema:
type: string
format: uuid
description: The ID of the greeting.
example: 62b36d15-0573-499f-8878-a395ca5b42f5
required: true
schemas:
Greeting:
type: object
properties:
id:
type: string
format: uuid
description: The uuid of the greeting.
example: 62b36d15-0573-499f-8878-a395ca5b42f5
from:
type: string
format: email
description: The email address of the sender of the greeting.
example: from@api-seed.com
to:
type: string
format: email
description: The email address of the receiver of the greeting.
example: to@api-seed.com
message:
type: string
description: The email address of the receiver of the greeting.
example: Happy Birthday!
createdOn:
type: string
format: 'date-time'
example: 2022-08-11T19:50:35.346Z
modifiedOn:
type: string
format: 'date-time'
example: 2022-08-11T20:15:23.346Z
Greetings:
type: array
items:
$ref: '#components/schemas/Greeting'
requestBodies:
CreateGreeting:
required: true
content:
'application/json':
schema:
description: The properties required to create a greeting.
properties:
from:
type: string
format: email
description: The email address of the sender of the greeting.
example: from@api-seed.com
to:
type: string
format: email
description: The email address of the receiver of the greeting.
example: to@api-seed.com
message:
type: string
maxLength: 140
description: The email address of the receiver of the greeting.
example: Happy Birthday!
UpdateGreeting:
required: true
content:
'application/json':
schema:
description: The properties required to create a new greeting.
properties:
message:
type: string
maxLength: 140
description: The email address of the receiver of the greeting.
example: Happy Anniversary!
responses:
GreetingsList:
description: Greetings list.
content:
'application/json':
schema:
$ref: '#components/schemas/Greetings'
GreetingDetails:
description: Greeting details.
content:
'application/json':
schema:
$ref: '#components/schemas/Greetings'
GreetingCreated:
description: Greeting created.
content:
'application/json':
schema:
$ref: '#components/schemas/Greeting'
GreetingDeleted:
description: Greeting deleted.
GreetingNotFound:
description: Greeting not found.
content:
'application/json':
schema:
properties:
status:
type: string
description: The status of the error.
example: Not found
statusCode:
type: number
description: The status code of the error.
example: 404
message:
type: string
description: A description of the error.
example: Greeting with id '62b36d15-0573-499f-8878-a395ca5b42f5' not found.