-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
160 lines (157 loc) · 4.21 KB
/
api.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
openapi: 3.0.0
info:
title: Customers API
description: CRUD for table of customers with AWS and Serverless Framework
version: 0.0.0
servers:
- url: https://boxg1l6wr4.execute-api.us-east-2.amazonaws.com/dev/
description: Server in aws with API Gateway and lambda funtions
paths:
/customer:
post:
summary: Create a customer
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name: string
surname: string
age: integer
typeDoc: string
city: string
dni: string
responses:
'201':
description: Customer created with success
content:
application/json:
schema:
type: array
'400':
description: Error in the requested data
/customer/{dni}:
put:
summary: Create a customer
parameters:
- name: dni
in: path
required: true
description: Identity document of client
schema:
type : string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name: string
surname: string
age: integer
typeDoc: string
city: string
dni: string
responses:
'202':
description: Customer update with success
content:
application/json:
schema:
type: array
'400':
description: Error in the requested data
delete:
summary: Delete a customer
parameters:
- name: dni
in: path
required: true
description: Identity document of client
schema:
type : string
responses:
'202':
description: Customer delete with success
get:
summary: Get a customer by dni
parameters:
- name: dni
in: path
required: true
description: Identity document of client
schema:
type : string
responses:
'200':
description: Customer got
content:
application/json:
schema:
type: object
properties:
name: string
surname: string
age: integer
typeDoc: string
city: string
dni: string
'404':
description: Customer not found
/customers:
get:
summary: Get alls customers
responses:
'200':
description: List of customers as array of objects
content:
application/json:
schema:
type: array
/customers/age/{filter}/{age}:
get:
summary: Return customer list older or younger than a specified age
parameters:
- name: filter
in: path
required: true
description: Age filter. Only 'up' or 'down' is accepted
schema:
type : string
- name: age
in: path
required: true
description: limiting age
schema:
type : integer || string
responses:
'200':
description: Returns list of clients that meet the condition
content:
application/json:
schema:
type: array
'404':
description: Invalidity petition. Error in sent fields.
/customers/typeDoc/{typeDoc}:
get:
summary: Returns customer list with the type of document indicated.
parameters:
- name: typeDoc
in: path
required: true
description: Type of document
schema:
type : string
responses:
'200':
description: Returns list of clients that meet the condition
content:
application/json:
schema:
type: array
'404':
description: Invalidity petition. Error in sent fields.