-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathswagger.yaml
136 lines (128 loc) · 3.3 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
swagger: "2.0"
info:
description: "Food Count"
version: "1.0.0"
title: "Finetune Challenge - Food Count"
contact:
email: "cristianoxavier_@outlook.com"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "{{host_with_port}}"
basePath: "/v1"
schemes:
- "https"
- "http"
paths:
#endpoints
/ping:
get:
tags:
- "Keepalive"
summary: "Api keepalive"
description: "Apikeepalive"
responses:
200:
description: "pong response"
operationId: "get_alive"
x-swagger-router-controller: "src.controllers.api_controller"
/food:
get:
tags:
- "Food List"
summary: "Retorna a lista de alimentos cadastrados"
description: "Retorna a lista de alimentos cadastrados"
responses:
200:
description: "Retorna a lista de alimentos cadastrados"
operationId: "get_list"
x-swagger-router-controller: "src.controllers.food_list_controller"
post:
tags:
- "Food List"
summary: "Adicionar um item a lista"
description: "Adicionar um item a lista"
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/FoodInput"
responses:
200:
description: 200 operation
schema:
$ref: "#/definitions/ArrayOfFoodOutput"
operationId: "send_to_food_list"
x-swagger-router-controller: "src.controllers.food_list_controller"
/food/{id}:
delete:
tags:
- "Food List"
summary: "Inativa um item da lista"
description: "Inativa um item da lista"
parameters:
- name: "id"
in: "path"
required: true
description: "O registro sera inativado"
type: "integer"
responses:
200:
description: "Registro deletado com sucesso"
500:
description: "Erro no servidor"
operationId: "delete_item"
x-swagger-router-controller: "src.controllers.food_list_controller"
/food/{date}:
get:
tags:
- "Food List"
summary: "Retorna a lista de alimentos filtrados pela data"
description: "Retorna a lista de alimentos filtrados pela data"
parameters:
- name: "date"
in: "path"
required: true
description: "Retorna a lista de alimentos filtrados pela data"
type: "string"
responses:
200:
description: "Registro deletado com sucesso"
500:
description: "Erro no servidor"
operationId: "get_list_by_date"
x-swagger-router-controller: "src.controllers.food_list_controller"
definitions:
FoodInput:
type: "object"
properties:
food_name:
type: string
example: bananas
food_type:
type: string
example: proteina
food_amount:
type: integer
example: 2
FoodOutput:
type: "object"
properties:
food_id:
type: integer
example: 10
food_name:
type: string
example: bananas
food_type:
type: string
example: proteina
food_amount:
type: integer
example: 2
ArrayOfFoodOutput:
type: "array"
items:
$ref: "#/definitions/FoodInput"