forked from rstropek/htl-leo-csharp-4
/
swagger.yaml
101 lines (101 loc) · 2.63 KB
/
swagger.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
openapi: 3.0.0
info:
description: HTL Programming Homework
version: 1.0.0
title: Address Book
paths:
/contacts:
get:
summary: Get all people in contact list
operationId: getAllPeople
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Person"
post:
summary: Adds a new person to the list of contacts
operationId: addPerson
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
description: Person to add
required: true
responses:
"201":
description: Person successfully created
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
headers:
Location:
description: URL where to get details of the created event
schema:
type: string
"400":
description: Invalid input (e.g. required field missing or empty)
"/contacts/{personId}":
delete:
summary: Deletes a person from the list of contacts
operationId: deletePerson
parameters:
- name: personId
in: path
description: ID of person to delete
required: true
schema:
type: integer
format: int32
responses:
"204":
description: Successful operation
"400":
description: Invalid ID supplied
"404":
description: Person not found
/contacts/findByName:
get:
summary: Finds person in contact list by name
description: Returns all people whose first of last name contains the specified name filter
operationId: findPersonByName
parameters:
- name: nameFilter
in: query
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Person"
"400":
description: Invalid or missing name
components:
schemas:
Person:
type: object
required:
- id
- email
properties:
id:
type: integer
format: int32
firstName:
type: string
lastName:
type: string
email:
type: string