-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.apib
More file actions
305 lines (222 loc) · 9.33 KB
/
Copy pathapi.apib
File metadata and controls
305 lines (222 loc) · 9.33 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
FORMAT: 1A
HOST: http://localhost:8000/api
# Feira API
A Feira API
# Data Structures
## Feira Request (object)
+ nome: PRACA SANTA HELENA (string, required) - Feira name
+ registro: 4003-7 (string, required) - Feira's registro in PMSP organ
+ long: `-46550164` (string, required) - Longitude
+ lat: `-23558733` (string, required) - Latitude
+ setcens: 355030885000091 (string, required) - Sensitive sector
+ areap: 02236686056 (string, required) - Pondered area
+ logradouro: AV MONS AGNELO (string, required) - Feira common area
+ number: 766 (string, required) - Feira number
+ referencia: TV AV DEP EMILIO CARLOS (string, optional) - Feira reference point
+ distrito_id: 34 (string, required) - Distrito ID
+ sub_pref_id: 11 (string, required) - Subprefeitura ID
+ sub_regiao_id: 11 (string, required) - SubRegiao ID
+ bairro_id: 99 (string, required) - Bairro ID
## Feira Response (object)
+ url: `http://localhost:8000/api/feiras/32` (string, required) - Distrito resource hyperlink
+ nome: PRACA SANTA HELENA (string, required) - Feira name
+ registro: 4003-7 (string, fixed) - Feira's registro in PMSP organ
+ long: `-46550164` (string, required) - Longitude
+ lat: `-23558733` (string, required) - Latitude
+ setcens: 355030885000091 (string, required) - Sensitive sector
+ areap: 02236686056 (string, required) - Pondered area
+ logradouro: AV MONS AGNELO (string, required) - Feira common area
+ number: 766 (string, required) - Feira number
+ referencia: TV AV DEP EMILIO CARLOS (string, optional) - Feira reference point
+ distrito (Distrito Response) - Feira Distrito
+ sub_pref (SubPrefeitura Response) - Feira Subprefeitura
+ sub_regiao (SubRegiao Response) - SubRegiao
+ bairro (Bairro Response) - Feira Bairro
## Distrito Response (object)
+ url: `http://localhost:8000/api/distritos/45` (string, required) - Distrito resource hyperlink
+ nome: PENHA (string, required) - Distrito name
+ cod_dist: 60 (string, required) - Distrito codigo as for IBGE
## SubPrefeitura Response (object)
+ url: `http://localhost:8000/api/sub-prefeituras/10` (string, required) - SubPrefeitura resource hyperlink
+ nome: MOOCA (string, required) - SubPrefeitura name
+ cod_sub_pref: 25 (string, required) - Sao Paulo's sub town hall code
## Regiao Response (object)]
+ url: `http://localhost:8000/api/regioes/97` (string, required) - Regiao resource hyperlink
+ nome: Oeste (string, required) - Regiao name
## SubRegiao Response (object)
+ url: `http://localhost:8000/api/sub-regioes/12` (string, required) - SubRegiao resource hyperlink
+ nome: Oeste 1 (string, required) - SubRegiao name
+ regiao (Regiao Response, required) - Regiao
## Bairro Response (object)
+ url: `http://localhost:8000/api/bairros/5` (string, required) - Bairro resource hyperlink
+ nome: VL Zelina (string, required) - Bairro name
## Generic Error Response
+ detail: Failed to proccess request (string) - Generic error message
## Validation Error Response
+ field: Field cannot be null (string) - Validation error message
## Paginated Feira Response
+ count: 80 (string, required) - Total resources
+ next: http://localhost:8000/feiras?page=4 (string, required) - Next page
+ previous: http://localhost:8000/feiras?page=3 (string, required) - Previous page
+ results (array[Feira Response])
## Paginated Distrito Response
+ count: 80 (string, required) - Total resources
+ next: http://localhost:8000/distritos?page=4 (string, required) - Next page
+ previous: http://localhost:8000/distritos?page=3 (string, required) - Previous page
+ results (array[Distrito Response])
## Paginated SubPrefeitura Response
+ count: 80 (string, required) - Total resources
+ next: `http://localhost:8000/sub-prefeituras?page=4` (string, required) - Next page
+ previous: `http://localhost:8000/sub-prefeituras?page=3` (string, required) - Previous page
+ results (array[SubPrefeitura Response])
## Paginated Regiao Response
+ count: 80 (string, required) - Total resources
+ next: http://localhost:8000/regioes?page=4 (string, required) - Next page
+ previous: http://localhost:8000/regioes?page=3 (string, required) - Previous page
+ results (array[Regiao Response])
## Paginated SubRegiao Response
+ count: 80 (string, required) - Total resources
+ next: `http://localhost:8000/sub-regioes?page=4` (string, required) - Next page
+ previous: `http://localhost:8000/sub-regioes?page=3` (string, required) - Previous page
+ results (array[SubRegiao Response])
## Paginated Bairro Response
+ count: 80 (string, required) - Total resources
+ next: http://localhost:8000/bairros?page=4 (string, required) - Next page
+ previous: http://localhost:8000/bairros?page=3 (string, required) - Previous page
+ results (array[Bairro Response])
# Group Feira [/feiras]
Feira collection
## List Feiras [GET /feiras{?distrito,regiao,nome,bairro,page,per_page}]
List feiras
+ Parameters
+ distrito: PENHA (string, optional) - Distrito name
+ regiao: Oeste (string, optional) - Feira's regiao
+ nome: PRACA SANTA HELENA (string, optional) - Feira name
+ bairro: VL Zelina (string, optional) - Feira bairro
+ page: 1 (string, optional) - Pagination page number
+ per_page: 1 (string, optional) - Pagination itens per page
+ Response 200 (application/json)
+ Attributes (Paginated Feira Response)
+ Response 400 (application/json)
+ Attributes
+ detail: Failed to proccess request (string) - Generic error message
+ field: Field cannot be null (string) - Validation error message
## Get Feira [GET /feiras/{id}]
+ Parameters
+ id: 10928 (string, required) - Feira id
+ Response 200 (application/json)
+ Attributes (Feira Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Create Feira [POST /feiras]
+ Request Create Feira (application/json)
+ Attributes (Feira Request)
+ Response 201 (application/json)
+ Attributes (Feira Response)
+ Response 400 (application/json)
+ Attributes
+ detail: Failed to proccess request (string) - Generic error message
+ field: Field cannot be null (string) - Validation error message
## Update Feira [PATCH /feiras/{id}]
+ Parameters
+ id: 298 (string, required) - Feira id
+ Request (application/json)
+ Attributes (Feira Request)
+ Response 201 (application/json)
+ Attributes (Feira Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
+ Response 400 (application/json)
+ Attributes
+ detail: Failed to proccess request (string) - Generic error message
+ field: Field cannot be null (string) - Validation error message
## Remove Feira [DELETE /feiras/{id}]
Remove a feira from database
+ Parameters
+ id: 555 (string, required) - Feira id
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
# Group Distrito [/distritos]
Distritos collection
## List Distritos [GET /distritos]
+ Response 200 (application/json)
+ Attributes (Paginated Distrito Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Get Distrito [GET /distritos/{id}]
+ Parameters
+ id: 555 (string, required) - Distrito id
+ Response 200 (application/json)
+ Attributes (Distrito Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
# Group SubPrefeitura [/sub-prefeituras]
Distritos collection
## List SubPrefeituras [GET /sub-prefeituras]
+ Response 200 (application/json)
+ Attributes (Paginated SubPrefeitura Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Get SubPrefeitura [GET /sub-prefeituras/{id}]
+ Parameters
+ id: 555 (string, required) - SubPrefeitura id
+ Response 200 (application/json)
+ Attributes (SubPrefeitura Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
# Group Bairro [/bairros]
Bairro collection
## List Bairros [GET /bairros]
+ Response 200 (application/json)
+ Attributes (Paginated Bairro Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Get Bairro [GET /bairros/{id}]
+ Parameters
+ id: 555 (string, required) - Bairro id
+ Response 200 (application/json)
+ Attributes (Bairro Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
# Group Regiao [/regioes]
Regiao collection
## List Regioes [GET /regioes]
+ Response 200 (application/json)
+ Attributes (Paginated Regiao Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Get Regiao [GET /regioes/{id}]
+ Parameters
+ id: 555 (string, required) - Regiao id
+ Response 200 (application/json)
+ Attributes (Regiao Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
# Group SubRegiao [/sub-regioes]
SubRegiao collection
## List SubRegioes [GET /sub-regioes]
+ Response 200 (application/json)
+ Attributes (Paginated SubRegiao Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)
## Get SubRegiao [GET /sub-regioes/{id}]
+ Parameters
+ id: 555 (string, required) - SubRegiao id
+ Response 200 (application/json)
+ Attributes (SubRegiao Response)
+ Response 404 (application/json)
+ Attributes
+ detail: Not found - (string)