-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathapi.yaml
More file actions
110 lines (107 loc) · 2.85 KB
/
Copy pathapi.yaml
File metadata and controls
110 lines (107 loc) · 2.85 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
openapi: "3.0.0"
info:
title: Test Schema
description: API to illustrate OpenAlchemy.
version: "1.0"
paths:
/employee:
get:
operationId: api.search
summary: Used to retrieve all employees.
responses:
200:
description: Return all employees from the database.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Employee"
post:
operationId: api.post
summary: Used to save an employee to the database.
requestBody:
description: The employee to save.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Employee"
responses:
200:
description: Save successful.
400:
description: The Employee already exists.
/employee/{id}:
parameters:
- in: path
name: id
schema:
type: integer
required: true
get:
operationId: api.get
summary: Used to retrieve an Employee from the database.
responses:
200:
description: The Employee.
content:
application/json:
schema:
$ref: "#/components/schemas/Employee"
404:
description: The Employee was not found.
patch:
operationId: api.patch
summary: Update an Employee in the database.
requestBody:
description: The employee to save.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Employee"
responses:
200:
description: The Employee was updated.
404:
description: The Employee was not found.
delete:
operationId: api.delete
summary: Delete an Employee from the database.
responses:
200:
description: The Employee was deleted.
404:
description: The Employee was not found.
components:
schemas:
Employee:
description: Person that works for a company.
type: object
x-tablename: employee
properties:
id:
type: integer
description: Unique identifier for the employee.
example: 0
x-primary-key: true
x-autoincrement: true
name:
type: string
description: The name of the employee.
example: David Andersson
x-index: true
division:
type: string
description: The part of the company the employee works in.
example: Engineering
x-index: true
salary:
type: number
description: The amount of money the employee is paid.
example: 1000000.00
required:
- id
- name
- division