-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.yml
More file actions
191 lines (183 loc) · 4.38 KB
/
api.yml
File metadata and controls
191 lines (183 loc) · 4.38 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
swagger: '2.0'
info:
version: 1.0.0
title: Microservice for Excursions
description: Ruby on Rails + Postgres
license:
name: Software Architecture 2019-I
host: 192.168.99.101:3000
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/suppliers:
post:
summary: Creates a new supplier
operationId: createSupplier
parameters:
- name: supplier
in: body
required: true
description: Supplier Object
schema:
$ref: '#/definitions/Supplier'
responses:
'201':
description: Created
'422':
description: Unprocessable_entity
'400':
description: Bad Request
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorModel'
get:
summary: Returns all suppliers
operationId: getAllSuppliers
responses:
'200':
description: Ok
schema:
$ref: '#/definitions/CoursesList'
'406':
description: Not Acceptable (Invalid Params)
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorModel'
/courses/{code}:
get:
summary: Returns a course with the given code
operationId: getCourseByCode
parameters:
- name: code
in: path
description: The code of the course to be returned
required: true
type: integer
responses:
'200':
description: Ok
schema:
$ref: '#/definitions/Course'
'404':
description: Not Found
schema:
$ref: '#/definitions/ErrorModel'
'406':
description: Not Acceptable (Invalid Params)
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: unexpected error
schema:
$ref: '#/definitions/ErrorModel'
put:
summary: Updates a course with the given code
operationId: updateCourse
parameters:
- name: code
in: path
description: The code of the course to be updated
required: true
type: integer
- name: course
in: body
required: true
description: Course Object
schema:
$ref: '#/definitions/CourseInput'
responses:
'204':
description: No Content
'404':
description: Not Found
schema:
$ref: '#/definitions/ErrorModel'
'406':
description: Not Acceptable (Invalid Params)
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: unexpected error
schema:
$ref: '#/definitions/ErrorModel'
delete:
summary: Deletes a course with the given code
operationId: deleteCourse
parameters:
- name: code
in: path
description: The code of the course to be deleted
required: true
type: integer
responses:
'200':
description: Ok
'404':
description: Not Found
schema:
$ref: '#/definitions/ErrorModel'
'406':
description: Not Acceptable (Invalid Params)
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: unexpected error
schema:
$ref: '#/definitions/ErrorModel'
definitions:
# Suppliers
Supplier:
type: object
properties:
Nit:
type: integer
Razon:
type: string
Telefono:
type: string
Correo:
type: string
Ubicacion:
type: string
CourseInput:
type: object
properties:
name:
type: string
credits:
type: integer
CoursesList:
type: object
required:
- total
- list
properties:
total:
type: number
list:
type: array
items:
$ref: '#/definitions/Course'
# Errors
ErrorModel:
type: object
required:
- message
- code
properties:
message:
type: string
code:
type: number
description:
type: object