-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathswagger.yml
124 lines (124 loc) · 2.62 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
123
124
---
swagger: "2.0"
info:
title: TestTask
description: This is test task for candidates
version: 1.0.0
paths:
/clients:
get:
tags:
- clients
summary: Get all clients
operationId: getClients
responses:
200:
description: Returns all clients
schema:
type: array
items:
$ref: '#/definitions/client'
post:
tags:
- clients
summary: Create client
operationId: createClient
parameters:
- name: body
in: body
description: Create client
required: true
schema:
$ref: '#/definitions/clientPOST'
responses:
200:
description: Returns client ID
schema:
type: integer
400:
description: Some error
schema:
type: string
/clients/{id}:
get:
tags:
- clients
summary: Get Client by ID
operationId: getOneCLient
responses:
200:
description: Client's information
schema:
$ref: '#/definitions/client'
404:
description: Not found
parameters:
- name: id
in: path
description: Client ID
required: true
type: integer
definitions:
client:
title: Root Type for client
description: Client's model
type: object
properties:
id:
format: int32
type: integer
last_name:
type: string
first_name:
type: string
dob:
format: date
type: string
social_status_id:
format: int32
type: integer
social_status:
type: string
gender_id:
type: string
gender:
type: string
example: |-
{
"id": 1,
"last_name": "Sharavara",
"first_name": "Vitalii",
"dob": "1990-11-12",
"social_status_id": 2,
"social_status": "Married",
"gender_id": "M",
"gender": "Male"
}
clientPOST:
title: Root Type for clientPOST
description: The root of the clientPOST type's schema.
type: object
properties:
last_name:
type: string
first_name:
type: string
dob:
format: date
type: string
social_status_id:
format: int32
type: integer
gender:
type: string
example: |-
{
"last_name": "Sharavara",
"first_name": "Vitalii",
"dob": "1990-11-12",
"social_status_id": 2,
"gender": "M"
}
tags:
- name: clients
description: Operations with clients