-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
122 lines (122 loc) · 2.6 KB
/
swagger.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
swagger: "2.0"
info:
title: "Titanic"
version: "1.0"
paths:
"/people":
get:
summary: "Get a list of all people"
operationId: "people.list"
responses:
200:
description: OK
schema:
$ref: "#/definitions/People"
produces:
- application/json
- text/html
post:
summary: "Add a person to the database"
operationId: "people.add"
parameters:
- in: body
name: person
required: true
schema:
$ref: "#/definitions/PersonData"
responses:
200:
description: "Added"
schema:
$ref: "#/definitions/Person"
produces:
- application/json
"/people/{uuid}":
get:
summary: "Get information about one person"
operationId: "person.get"
responses:
200:
description: OK
schema:
$ref: "#/definitions/Person"
404:
description: Not found
parameters:
- in: path
required: true
name: uuid
type: string
format: uuid
produces:
- application/json
- text/html
put:
summary: "Update information about one person"
operationId: "person.update"
responses:
200:
description: Updated
schema:
$ref: "#/definitions/Person"
404:
description: Not found
parameters:
- in: path
required: true
name: uuid
type: string
format: uuid
- in: body
name: person
required: true
schema:
$ref: "#/definitions/PersonData"
produces:
- application/json
delete:
summary: "Delete this person"
operationId: "person.delete"
responses:
200:
description: OK
404:
description: Not found
parameters:
- in: path
required: true
name: uuid
type: string
format: uuid
definitions:
People:
type: array
items:
$ref: "#/definitions/Person"
Person:
allOf:
- $ref: "#/definitions/PersonData"
- type: object
properties:
uuid:
type: string
format: uuid
PersonData:
properties:
survived:
type: boolean
passengerClass:
type: integer
name:
type: string
sex:
type: string
enum: [male, female, other]
age:
type: integer
siblingsOrSpousesAboard:
type: integer
parentsOrChildrenAboard:
type: integer
fare:
type: number