Changeset be25db1 for src/mapservice/src-gen
- Timestamp:
- Apr 22, 2019, 5:39:46 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 041e464
- Parents:
- 5e4cb73
- Location:
- src/mapservice/src-gen
- Files:
-
- 10 edited
-
openapi_server/controllers/waters_controller.py (modified) (2 diffs)
-
openapi_server/models/__init__.py (modified) (1 diff)
-
openapi_server/models/water.py (modified) (1 diff)
-
openapi_server/models/water_creation.py (modified) (1 diff)
-
openapi_server/openapi/openapi.yaml (modified) (12 diffs)
-
openapi_server/static/js/GnuBoat.Webserver.js (modified) (1 diff)
-
openapi_server/test/__init__.py (modified) (1 diff)
-
openapi_server/test/test_default_controller.py (modified) (2 diffs)
-
openapi_server/test/test_waters_controller.py (modified) (3 diffs)
-
requirements.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice/src-gen/openapi_server/controllers/waters_controller.py
r5e4cb73 rbe25db1 23 23 from openapi_server.server_impl.controllers import WatersController 24 24 25 def waters_create(water_creation=None): # noqa: E501 26 """Add a new water 27 28 Adds a new water to the database # noqa: E501 29 30 :param water_creation: 31 :type water_creation: dict | bytes 32 33 :rtype: Water 34 """ 35 if connexion.request.is_json: 36 water_creation = WaterCreation.from_dict(connexion.request.get_json()) # noqa: E501 37 return WatersController.waters_create(water_creation=water_creation) 38 39 from openapi_server.server_impl.controllers import WatersController 40 25 41 def waters_get(name=None, manager=None, order_by=None, offset=None, limit=None): # noqa: E501 26 42 """Find waters by id … … 42 58 """ 43 59 return WatersController.waters_get(name=name, manager=manager, order_by=order_by, offset=offset, limit=limit) 44 45 from openapi_server.server_impl.controllers import WatersController46 47 def waters_post(water_creation=None): # noqa: E50148 """Add a new water49 50 Adds a new water to the database # noqa: E50151 52 :param water_creation: item id of water is going to be ignored53 :type water_creation: dict | bytes54 55 :rtype: Water56 """57 if connexion.request.is_json:58 water_creation = WaterCreation.from_dict(connexion.request.get_json()) # noqa: E50159 return WatersController.waters_post(water_creation=water_creation) -
src/mapservice/src-gen/openapi_server/models/__init__.py
r5e4cb73 rbe25db1 6 6 from openapi_server.models.http_error import HttpError 7 7 from openapi_server.models.order import Order 8 from openapi_server.models.user import User 9 from openapi_server.models.user_creation import UserCreation 8 10 from openapi_server.models.water import Water 9 11 from openapi_server.models.water_creation import WaterCreation -
src/mapservice/src-gen/openapi_server/models/water.py
r5e4cb73 rbe25db1 42 42 43 43 self.attribute_map = { 44 'water_id': 'water _id',44 'water_id': 'waterId', 45 45 'name': 'name', 46 46 'manager': 'manager', 47 'osm_id': 'osm _id',48 'osm_type': 'osm _type',47 'osm_id': 'osmId', 48 'osm_type': 'osmType', 49 49 'osm_class': 'osm_class' 50 50 } -
src/mapservice/src-gen/openapi_server/models/water_creation.py
r5e4cb73 rbe25db1 34 34 self.attribute_map = { 35 35 'name': 'name', 36 'osm_id': 'osm _id',37 'osm_type': 'osm _type'36 'osm_id': 'osmId', 37 'osm_type': 'osmType' 38 38 } 39 39 -
src/mapservice/src-gen/openapi_server/openapi/openapi.yaml
r5e4cb73 rbe25db1 25 25 - description: A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North Sea) 26 26 name: waters 27 - description: All actions used to manage users and api keys 28 name: users 27 29 paths: 30 /user: 31 get: 32 description: Returns information for a user 33 operationId: users_get 34 responses: 35 200: 36 content: 37 application/json: 38 examples: 39 User: 40 $ref: '#/components/examples/User' 41 schema: 42 $ref: '#/components/schemas/User' 43 description: OK 44 400: 45 content: 46 application/json: 47 examples: 48 HttpError: 49 $ref: '#/components/examples/HttpError' 50 schema: 51 $ref: '#/components/schemas/HttpError' 52 description: Bad Request (400) 53 401: 54 content: 55 application/json: 56 examples: 57 HttpError: 58 $ref: '#/components/examples/HttpError' 59 schema: 60 $ref: '#/components/schemas/HttpError' 61 description: Unauthorized (401) acces to resource 62 security: 63 - basicAuth: [] 64 - apiKeyAuth: [] 65 summary: Returns info of a user 66 tags: 67 - users 68 x-openapi-router-controller: openapi_server.controllers.users_controller 69 options: 70 description: Used by CORS preflight 71 operationId: user_options 72 responses: 73 200: 74 content: 75 application/json: {} 76 description: CORS prefilght requests should return 200 as status code 77 tags: 78 - users 79 x-openapi-router-controller: openapi_server.controllers.users_controller 80 post: 81 description: Registers a new user 82 operationId: users_register 83 requestBody: 84 content: 85 application/json: 86 examples: 87 Water: 88 $ref: '#/components/examples/UserCreation' 89 schema: 90 $ref: '#/components/schemas/UserCreation' 91 responses: 92 201: 93 content: 94 application/json: 95 examples: 96 Water: 97 $ref: '#/components/examples/User' 98 schema: 99 $ref: '#/components/schemas/User' 100 description: Userr created 101 400: 102 content: 103 application/json: 104 examples: 105 HttpError: 106 $ref: '#/components/examples/HttpError' 107 schema: 108 $ref: '#/components/schemas/HttpError' 109 description: Bad Request (400) 110 summary: Registers a new user 111 tags: 112 - users 113 x-openapi-router-controller: openapi_server.controllers.users_controller 114 /user/apikey_create: 115 get: 116 description: Generates and returns a new API key for current user 117 operationId: users_api_key_create 118 responses: 119 200: 120 content: 121 application/json: 122 example: NewApiKey4711 123 schema: 124 $ref: '#/components/schemas/apiKeys' 125 description: OK 126 400: 127 content: 128 application/json: 129 examples: 130 HttpError: 131 $ref: '#/components/examples/HttpError' 132 schema: 133 $ref: '#/components/schemas/HttpError' 134 description: Bad Request (400) 135 401: 136 content: 137 application/json: 138 examples: 139 HttpError: 140 $ref: '#/components/examples/HttpError' 141 schema: 142 $ref: '#/components/schemas/HttpError' 143 description: Unauthorized (401) acces to resource 144 security: 145 - basicAuth: [] 146 - apiKeyAuth: [] 147 summary: Returns a new API key 148 tags: 149 - users 150 x-openapi-router-controller: openapi_server.controllers.users_controller 151 /user/{api_key}: 152 delete: 153 description: Deletes given API key and returns remaining API keys of the user 154 operationId: users_api_key_delete 155 parameters: 156 - description: API key 157 example: DelApiKey4711 158 explode: false 159 in: path 160 name: api_key 161 required: true 162 schema: 163 $ref: '#/components/schemas/apiKey' 164 style: simple 165 responses: 166 200: 167 content: 168 application/json: 169 example: ApiKey4711 170 schema: 171 $ref: '#/components/schemas/apiKeys' 172 description: OK 173 400: 174 content: 175 application/json: 176 examples: 177 HttpError: 178 $ref: '#/components/examples/HttpError' 179 schema: 180 $ref: '#/components/schemas/HttpError' 181 description: Bad Request (400) 182 401: 183 content: 184 application/json: 185 examples: 186 HttpError: 187 $ref: '#/components/examples/HttpError' 188 schema: 189 $ref: '#/components/schemas/HttpError' 190 description: Unauthorized (401) acces to resource 191 security: 192 - basicAuth: [] 193 - apiKeyAuth: [] 194 summary: Deletes API key 195 tags: 196 - users 197 x-openapi-router-controller: openapi_server.controllers.users_controller 198 /user/activate/{activation_code}: 199 get: 200 description: Activates a user account 201 operationId: users_activate 202 parameters: 203 - description: Activation code 204 example: dac9630aec642a428cd73f4be0a03569 205 explode: false 206 in: path 207 name: activation_code 208 required: true 209 schema: 210 $ref: '#/components/schemas/activationCode' 211 style: simple 212 responses: 213 302: 214 description: OK or not OK 215 headers: 216 Location: 217 description: URL to the website, showing the result of the activation 218 explode: false 219 schema: 220 type: string 221 style: simple 222 summary: Activates a user account 223 tags: 224 - users 225 x-openapi-router-controller: openapi_server.controllers.users_controller 28 226 /waters: 29 227 get: … … 31 229 operationId: waters_get 32 230 parameters: 33 - explode: false 34 in: header 231 - example: Missi 232 explode: true 233 in: query 35 234 name: name 36 235 required: false 37 236 schema: 38 237 $ref: '#/components/schemas/item_name' 39 style: simple 40 - explode: false 41 in: header 238 style: form 239 - example: jane 240 explode: true 241 in: query 42 242 name: manager 43 243 required: false 44 244 schema: 45 245 $ref: '#/components/schemas/username' 46 style: simple246 style: form 47 247 - description: 'Order by field: name' 48 248 explode: true … … 52 252 schema: 53 253 default: name 254 example: name 54 255 type: string 55 256 style: form … … 92 293 post: 93 294 description: Adds a new water to the database 94 operationId: waters_ post295 operationId: waters_create 95 296 requestBody: 96 297 content: … … 101 302 schema: 102 303 $ref: '#/components/schemas/WaterCreation' 103 description: item id of water is going to be ignored104 304 responses: 105 305 201: … … 175 375 components: 176 376 examples: 377 User: 378 value: 379 username: jane 380 email: jane@example.org 381 firstName: Jane 382 lastName: Doe 383 activated: true 384 apiKeys: 385 - ApiKey4701 386 UserCreation: 387 value: 388 username: richard 389 email: richard@examle.org 390 firstName: Richard 391 lastName: Roe 392 password: sdfl.1238_ASDkeil? 177 393 Water: 178 394 summary: A water example object 179 395 value: 180 water _id: 1396 waterId: 1 181 397 name: Mississippi 182 osm _id: 1756854183 osm _type: R398 osmId: 1756854 399 osmType: R 184 400 link: http://gnuboat.engsas.com/mapservice/v1/waters/1 185 401 WaterCreation: … … 187 403 value: 188 404 name: Mississippi 189 osm _id: 1756854190 osm _type: R405 osmId: 1756854 406 osmType: R 191 407 waters: 192 408 summary: A sample list with waters 193 409 value: 194 - water _id: 1410 - waterId: 1 195 411 name: Mississippi 196 osm _id: 1756854197 osm _type: R412 osmId: 1756854 413 osmType: R 198 414 link: http://gnuboat.engsas.com/mapservice/v1/waters/1 199 - water _id: 2415 - waterId: 2 200 416 name: Bodensee 201 417 link: http://gnuboat.engsas.com/mapservice/v1/waters/2 … … 213 429 schema: 214 430 default: name 431 example: name 215 432 type: string 216 433 style: form … … 280 497 title: Username 281 498 type: string 499 apiKey: 500 title: API Key 501 type: string 502 apiKeys: 503 items: 504 $ref: '#/components/schemas/apiKey' 505 title: Array of API keys 506 type: array 507 activationCode: 508 title: Activation code for a User 509 type: string 282 510 item_id: 283 511 format: int32 … … 287 515 title: Item Name 288 516 type: string 289 osm _type:517 osmType: 290 518 maxLength: 1 291 519 minLength: 1 292 520 type: string 521 User: 522 example: 523 firstName: firstName 524 lastName: lastName 525 apiKeys: 526 - null 527 - null 528 email: email 529 username: username 530 activated: true 531 properties: 532 username: 533 title: Username 534 type: string 535 email: 536 type: string 537 firstName: 538 type: string 539 lastName: 540 type: string 541 activated: 542 type: boolean 543 apiKeys: 544 items: 545 $ref: '#/components/schemas/apiKey' 546 title: Array of API keys 547 type: array 548 title: User 549 type: object 550 UserCreation: 551 example: 552 firstName: firstName 553 lastName: lastName 554 password: password 555 email: email 556 username: username 557 properties: 558 username: 559 title: Username 560 type: string 561 email: 562 type: string 563 firstName: 564 type: string 565 lastName: 566 type: string 567 password: 568 type: string 569 required: 570 - email 571 - firstName 572 - lastName 573 - password 574 - username 575 title: User 576 type: object 293 577 Water: 294 578 example: 295 osm_id: 6296 osm_type: osm_type297 579 manager: manager 580 osmId: 6 298 581 name: name 299 water_id: 0582 osmType: osmType 300 583 osm_class: osm_class 584 waterId: 0 301 585 properties: 302 water _id:586 waterId: 303 587 format: int32 304 588 title: Item ID … … 310 594 title: Username 311 595 type: string 312 osm _id:596 osmId: 313 597 format: int32 314 598 title: Item ID 315 599 type: integer 316 osm _type:600 osmType: 317 601 maxLength: 1 318 602 minLength: 1 … … 324 608 required: 325 609 - name 326 - water _id610 - waterId 327 611 title: Water 328 612 type: object 329 613 WaterCreation: 330 614 example: 331 osm_id: 0 332 osm_type: osm_type 615 osmId: 0 333 616 name: name 617 osmType: osmType 334 618 properties: 335 619 name: 336 620 title: Item Name 337 621 type: string 338 osm _id:622 osmId: 339 623 format: int32 340 624 title: Item ID 341 625 type: integer 342 osm _type:626 osmType: 343 627 maxLength: 1 344 628 minLength: 1 -
src/mapservice/src-gen/openapi_server/static/js/GnuBoat.Webserver.js
r5e4cb73 rbe25db1 111 111 // getting my waters 112 112 $.ajax({ 113 headers: {114 // manager: Cookies.get('username')115 manager: "bla"116 },117 113 dataType: "json", 118 url: GnuBoat.Webserver.private.serverBaseUrl +'waters ',114 url: GnuBoat.Webserver.private.serverBaseUrl +'waters?manager='+ encodeURIComponent(Cookies.get('username')), 119 115 }).done(function(data) { 120 116 GnuBoat.Webserver.private.loggedin = true; -
src/mapservice/src-gen/openapi_server/test/__init__.py
r5e4cb73 rbe25db1 2 2 3 3 import connexion 4 from flask_cors import CORS 4 5 from flask_testing import TestCase 5 6 6 7 from openapi_server.encoder import JSONEncoder 7 8 9 from openapi_server.server_impl.database.Model import db, db_test_setup 8 10 9 11 class BaseTestCase(TestCase): 12 def create_app(self): 13 logging.getLogger('connexion.operation').setLevel('ERROR') 14 app = connexion.App(__name__, specification_dir='../openapi/') 15 application = app.app 16 CORS(application) 17 application.json_encoder = JSONEncoder 18 app.add_api('openapi.yaml') 10 19 11 def create_app(self): 12 logging.getLogger('connexion.operation').setLevel('ERROR') 13 app = connexion.App(__name__, specification_dir='../openapi/') 14 app.app.json_encoder = JSONEncoder 15 app.add_api('openapi.yaml') 16 return app.app 20 application.config.from_object('openapi_server.server_impl.Config.TestingConfig') 21 db.init_app(application) 22 application.app_context().push() 23 24 return application 25 26 def setUp(self): 27 db.drop_all() 28 db_test_setup() 29 30 def tearDown(self): 31 db.session.remove() 32 db.drop_all() -
src/mapservice/src-gen/openapi_server/test/test_default_controller.py
r5e4cb73 rbe25db1 7 7 from six import BytesIO 8 8 9 from openapi_server.models.water import Water # noqa: E50110 9 from openapi_server.test import BaseTestCase 11 10 … … 14 13 """DefaultController integration test stubs""" 15 14 16 def test_ water_get_by_id(self):17 """Test case for water_get_by_id15 def test_user_options(self): 16 """Test case for user_options 18 17 19 Represents a water18 20 19 """ 21 20 headers = { 22 21 } 23 22 response = self.client.open( 24 '/mapservice/v1/ waters/{id}'.format(id=56),25 method=' GET',23 '/mapservice/v1/user', 24 method='OPTIONS', 26 25 headers=headers) 27 26 self.assert200(response, -
src/mapservice/src-gen/openapi_server/test/test_waters_controller.py
r5e4cb73 rbe25db1 2 2 3 3 from __future__ import absolute_import 4 import unittest 4 5 5 6 from flask import json 6 7 from six import BytesIO 7 8 8 from openapi_server.models.order import Order # noqa: E501 9 from openapi_server.models.http_error import HttpError # noqa: E501 10 from openapi_server.models.water import Water # noqa: E501 11 from openapi_server.models.water_creation import WaterCreation # noqa: E501 9 12 from openapi_server.test import BaseTestCase 10 13 … … 13 16 """WatersController integration test stubs""" 14 17 18 def test_water_get_by_id(self): 19 """Test case for water_get_by_id 20 21 Represents a water 22 """ 23 headers = { 24 } 25 response = self.client.open( 26 '/mapservice/v1/waters/{id}'.format(id='56'), 27 method='GET', 28 headers=headers) 29 self.assert200(response, 30 'Response body is : ' + response.data.decode('utf-8')) 31 32 def test_waters_create(self): 33 """Test case for waters_create 34 35 Add a new water 36 """ 37 water_creation = WaterCreation() 38 headers = { 39 'X-API-KEY': 'test_key', 40 41 } 42 response = self.client.open( 43 '/mapservice/v1/waters', 44 method='POST', 45 headers=headers, 46 data=json.dumps(water_creation), 47 content_type='application/json') 48 self.assert200(response, 49 'Response body is : ' + response.data.decode('utf-8')) 50 15 51 def test_waters_get(self): 16 52 """Test case for waters_get 17 53 18 Waters_GET54 Find waters by id 19 55 """ 20 query_string = [('order_by', 'order_by_example'), 21 ('order', Order()), 22 ('offset', 0), 23 ('limit', 10)] 56 query_string = [('name', 'Missi'), 57 ('manager', 'jane'), 58 ('order_by', 'name'), 59 ('offset', '0'), 60 ('limit', '10')] 61 headers = { 62 } 24 63 response = self.client.open( 25 64 '/mapservice/v1/waters', 26 65 method='GET', 66 headers=headers, 27 67 query_string=query_string) 28 68 self.assert200(response, … … 31 71 32 72 if __name__ == '__main__': 33 import unittest34 73 unittest.main() -
src/mapservice/src-gen/requirements.txt
r5e4cb73 rbe25db1 3 3 python_dateutil == 2.6.0 4 4 setuptools >= 21.0.0 5 flask-sqlalchemy 6 flask-cors
Note:
See TracChangeset
for help on using the changeset viewer.
