source: src/webapp/mapservice/openapi.yaml@ 3a89adb

debian/bullseye
Last change on this file since 3a89adb was 3a89adb, checked in by Joachim Langenbach <joachim.langenbach@…>, 8 years ago

Moved mapservice to python flask with openapi generator

  • Property mode set to 100644
File size: 7.5 KB
Line 
1openapi: 3.0.0
2info:
3 title: GNUBoat Mapservice API
4 contact:
5 name: EngSaS - Engineering Solutions and Services Langenbach
6 url: 'http://www.engsas.com'
7 email: info@engsas.de
8 license:
9 name: GPL 3
10 url: 'https://www.gnu.org/licenses/gpl-3.0.en.html'
11 version: v1
12 description: API to upload log files with water depth to GNUBoat server
13servers:
14 - url: 'https://gnuboat.engsas.com/mapservice/{version}'
15 description: The production API server
16 variables:
17 version:
18 default: v1
19 - url: 'http://localhost:8080/mapservice/{version}'
20 description: The local flask development url
21 variables:
22 version:
23 default: v1
24paths:
25 /waters:
26 get:
27 description: Returns all waters
28 tags:
29 - waters
30 summary: Find waters by id
31 operationId: watersGet
32 parameters:
33 - name: name
34 in: header
35 schema:
36 $ref: '#/components/schemas/item_name'
37 - name: manager
38 in: header
39 schema:
40 $ref: '#/components/schemas/username'
41 - $ref: '#/components/parameters/orderBy'
42 - $ref: '#/components/parameters/offset'
43 - $ref: '#/components/parameters/limit'
44 responses:
45 '200':
46 description: OK
47 content:
48 application/json:
49 schema:
50 $ref: '#/components/schemas/waters'
51 examples:
52 Waters:
53 $ref: '#/components/examples/waters'
54 post:
55 description: Adds a new water to the database
56 tags:
57 - waters
58 summary: Add a new water
59 security:
60 - basicAuth: []
61 - apiKeyAuth: []
62 requestBody:
63 description: item id of water is going to be ignored
64 content:
65 application/json:
66 schema:
67 $ref: '#/components/schemas/WaterCreation'
68 examples:
69 Water:
70 $ref: '#/components/examples/WaterCreation'
71 responses:
72 '201':
73 description: Water created
74 content:
75 application/json:
76 schema:
77 $ref: '#/components/schemas/Water'
78 examples:
79 Water:
80 $ref: '#/components/examples/Water'
81 '400':
82 $ref: '#/components/responses/BadRequest'
83 '401':
84 $ref: '#/components/responses/Unauthorized'
85 '/waters/{id}':
86 get:
87 description: Returns the water identified by id
88 tags:
89 - waters
90 summary: Represents a water
91 operationId: waterGetById
92 parameters:
93 - name: id
94 in: path
95 description: Item ID
96 required: true
97 schema:
98 $ref: '#/components/schemas/item_id'
99 responses:
100 '200':
101 description: OK
102 content:
103 application/json:
104 schema:
105 $ref: '#/components/schemas/Water'
106 examples:
107 Water:
108 $ref: '#/components/examples/Water'
109 '404':
110 $ref: '#/components/responses/NotFound'
111components:
112 securitySchemes:
113 basicAuth:
114 type: http
115 scheme: basic
116 x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic
117 apiKeyAuth:
118 type: apiKey
119 in: header
120 name: X-API-KEY
121 x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api
122 schemas:
123 username:
124 title: Username
125 type: string
126 item_id:
127 title: Item ID
128 type: integer
129 format: int32
130 item_name:
131 title: Item Name
132 type: string
133 osm_type:
134 maxLength: 1
135 minLength: 1
136 type: string
137 Water:
138 title: Water
139 type: object
140 properties:
141 water_id:
142 $ref: '#/components/schemas/item_id'
143 name:
144 $ref: '#/components/schemas/item_name'
145 manager:
146 $ref: '#/components/schemas/username'
147 osm_id:
148 $ref: '#/components/schemas/item_id'
149 osm_type:
150 $ref: '#/components/schemas/osm_type'
151 osm_class:
152 $ref: '#/components/schemas/osm_type'
153 required:
154 - water_id
155 - name
156 WaterCreation:
157 title: Water
158 type: object
159 properties:
160 name:
161 $ref: '#/components/schemas/item_name'
162 osm_id:
163 $ref: '#/components/schemas/item_id'
164 osm_type:
165 $ref: '#/components/schemas/osm_type'
166 required:
167 - name
168 waters:
169 title: waters
170 type: array
171 items:
172 $ref: '#/components/schemas/Water'
173 order:
174 title: order
175 enum:
176 - desc
177 - asc
178 type: string
179 default: asc
180 description: |
181 Sort order:
182 * `asc` - Ascending, from A to Z
183 * `desc` - Descending, from Z to A
184 example: asc
185 HttpError:
186 title: HTTP Error Response Object
187 type: object
188 properties:
189 code:
190 type: integer
191 message:
192 type: string
193 required:
194 - code
195 - message
196 parameters:
197 orderBy:
198 name: orderBy
199 in: query
200 description: 'Order by field: name'
201 schema:
202 type: string
203 default: name
204 order:
205 name: order
206 in: query
207 description: Order
208 schema:
209 $ref: '#/components/schemas/order'
210 offset:
211 name: offset
212 in: query
213 description: >-
214 Skip over a number of elements by specifying an offset value for the
215 query
216 schema:
217 type: integer
218 format: int32
219 default: 0
220 example: 0
221 limit:
222 name: limit
223 in: query
224 description: Limit the number of elements on the response
225 style: form
226 explode: true
227 schema:
228 type: integer
229 format: int32
230 default: 10
231 example: 10
232 examples:
233 Water:
234 value:
235 water_id: 1
236 name: Mississippi
237 osm_id: 1756854
238 osm_type: R
239 link: 'http://gnuboat.engsas.com/mapservice/v1/waters/1'
240 summary: A water example object
241 WaterCreation:
242 value:
243 name: Mississippi
244 osm_id: 1756854
245 osm_type: R
246 summary: A water example object for creation of a water
247 waters:
248 value:
249 - water_id: 1
250 name: Mississippi
251 osm_id: 1756854
252 osm_type: R
253 link: 'http://gnuboat.engsas.com/mapservice/v1/waters/1'
254 - water_id: 2
255 name: Bodensee
256 link: 'http://gnuboat.engsas.com/mapservice/v1/waters/2'
257 summary: A sample list with waters
258 HttpError:
259 value:
260 code: 404
261 message: Water with id 999999 not found
262 responses:
263 BadRequest:
264 description: Bad Request (400)
265 content:
266 application/json:
267 schema:
268 $ref: '#/components/schemas/HttpError'
269 examples:
270 HttpError:
271 $ref: '#/components/examples/HttpError'
272 Unauthorized:
273 description: Unauthorized (401) acces to resource
274 content:
275 application/json:
276 schema:
277 $ref: '#/components/schemas/HttpError'
278 examples:
279 HttpError:
280 $ref: '#/components/examples/HttpError'
281 NotFound:
282 description: Water with given Id not found
283 content:
284 application/json:
285 schema:
286 $ref: '#/components/schemas/HttpError'
287 examples:
288 HttpError:
289 $ref: '#/components/examples/HttpError'
290tags:
291 - name: waters
292 description: >-
293 A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North
294 Sea)
Note: See TracBrowser for help on using the repository browser.