/
swagger.yaml
122 lines (118 loc) · 2.83 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
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:
description: "Employee Management System"
version: "0.0.1"
title: "Employee system"
host: "localhost:8080"
basePath: "/"
schemes:
- "http"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/:
post:
operationId: "addEmployee"
parameters:
- in: "body"
name: "employee"
description: "employee's details"
required: false
schema:
$ref: "#/definitions/employee"
responses:
201:
description: "employee added"
schema:
$ref: "#/definitions/employee"
409:
description: "employee already exists"
500:
description: "internal server error"
get:
operationId: "ListEmployees"
description: "get all the employees"
responses:
200:
description: "employee response"
schema:
type: "array"
items:
$ref: "#/definitions/employee"
500:
description: "internal server error"
/{ID}:
get:
operationId: "GetEmployeeByID"
parameters:
- in: "path"
type: "string"
name: "ID"
required: true
description: "UUID of the employee"
description: "get employee with id provided in url"
responses:
200:
description: "employee response"
schema:
$ref: "#/definitions/employee"
404:
description: "employee not found"
500:
description: "internal server error"
put:
operationId: "updateEmployee"
parameters:
- in: "path"
type: "string"
name: "ID"
required: true
description: "UUID of the employee"
- in: "body"
name: "employee"
description: "employee's details"
required: false
schema:
$ref: "#/definitions/employee"
responses:
200:
description: "employee updated"
schema:
$ref: "#/definitions/employee"
500:
description: "internal server error"
delete:
operationId: "DeleteEmployee"
parameters:
- in: "path"
name: "ID"
type: "string"
description: "UUID of the employee"
required: true
description: "delete employee with id provided in url"
responses:
204:
description: "employee deleted"
404:
description: "employee not found"
500:
description: "internal server error"
definitions:
employee:
type: "object"
properties:
ID:
type: "string"
Name:
type: "string"
Address:
type: "string"
Age:
type: "integer"
Salary:
type: "integer"
Phone:
type: "integer"