openapi: 3.0.0 info: contact: email: info@engsas.de name: EngSaS - Engineering Solutions and Services Langenbach url: http://www.engsas.com description: API to upload log files with water depth to GNUBoat server license: name: GPL 3 url: https://www.gnu.org/licenses/gpl-3.0.en.html title: GNUBoat Mapservice API version: v1 servers: - description: The production API server url: https://gnuboat.engsas.com/mapservice/{version} variables: version: default: v1 - description: The local flask development url url: http://localhost:8080/mapservice/{version} variables: version: default: v1 tags: - description: A water is a river (like Mississippi, lake (Lake Ontario), or a sea (North Sea) name: waters - description: All actions used to manage users and api keys name: users paths: /user: get: description: Returns information for a user operationId: users_get responses: 200: content: application/json: examples: User: $ref: '#/components/examples/User' schema: $ref: '#/components/schemas/User' description: OK 400: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) 401: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Unauthorized (401) acces to resource security: - basicAuth: [] - apiKeyAuth: [] summary: Returns info of a user tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller options: description: Used by CORS preflight operationId: user_options responses: 200: content: application/json: {} description: CORS prefilght requests should return 200 as status code tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller post: description: Registers a new user operationId: users_register requestBody: content: application/json: examples: Water: $ref: '#/components/examples/UserCreation' schema: $ref: '#/components/schemas/UserCreation' responses: 201: content: application/json: examples: Water: $ref: '#/components/examples/User' schema: $ref: '#/components/schemas/User' description: Userr created 400: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) summary: Registers a new user tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller /user/apikey_create: get: description: Generates and returns a new API key for current user operationId: users_api_key_create responses: 200: content: application/json: example: NewApiKey4711 schema: $ref: '#/components/schemas/apiKeys' description: OK 400: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) 401: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Unauthorized (401) acces to resource security: - basicAuth: [] - apiKeyAuth: [] summary: Returns a new API key tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller /user/{api_key}: delete: description: Deletes given API key and returns remaining API keys of the user operationId: users_api_key_delete parameters: - description: API key example: DelApiKey4711 explode: false in: path name: api_key required: true schema: $ref: '#/components/schemas/apiKey' style: simple responses: 200: content: application/json: example: ApiKey4711 schema: $ref: '#/components/schemas/apiKeys' description: OK 400: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) 401: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Unauthorized (401) acces to resource security: - basicAuth: [] - apiKeyAuth: [] summary: Deletes API key tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller /user/activate/{activation_code}: get: description: Activates a user account operationId: users_activate parameters: - description: Activation code example: dac9630aec642a428cd73f4be0a03569 explode: false in: path name: activation_code required: true schema: $ref: '#/components/schemas/activationCode' style: simple responses: 302: description: OK or not OK headers: Location: description: URL to the website, showing the result of the activation explode: false schema: type: string style: simple summary: Activates a user account tags: - users x-openapi-router-controller: openapi_server.controllers.users_controller /waters: get: description: Returns all waters operationId: waters_get parameters: - example: Missi explode: true in: query name: name required: false schema: $ref: '#/components/schemas/itemName' style: form - example: jane explode: true in: query name: manager required: false schema: $ref: '#/components/schemas/username' style: form - description: 'Order by field: name' explode: true in: query name: orderBy required: false schema: default: name example: name type: string style: form - description: Skip over a number of elements by specifying an offset value for the query explode: true in: query name: offset required: false schema: default: 0 example: 0 format: int32 type: integer style: form - description: Limit the number of elements on the response explode: true in: query name: limit required: false schema: default: 10 example: 10 format: int32 type: integer style: form responses: 200: content: application/json: examples: Waters: $ref: '#/components/examples/waters' schema: $ref: '#/components/schemas/waters' description: OK summary: Find waters by id tags: - waters x-openapi-router-controller: openapi_server.controllers.waters_controller post: description: Adds a new water to the database operationId: waters_create requestBody: content: application/json: example: name: Rhein osmId: 1756854 osmType: Relation schema: $ref: '#/components/schemas/WaterCreation' responses: 201: content: application/json: examples: Water: $ref: '#/components/examples/Water' schema: $ref: '#/components/schemas/Water' description: Water created 400: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) 401: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Unauthorized (401) acces to resource security: - basicAuth: [] - apiKeyAuth: [] summary: Add a new water tags: - waters x-openapi-router-controller: openapi_server.controllers.waters_controller /waters/{id}: get: description: Returns the water identified by id operationId: water_get_by_id parameters: - description: Item ID explode: false in: path name: id required: true schema: $ref: '#/components/schemas/itemId' style: simple responses: 200: content: application/json: examples: Water: $ref: '#/components/examples/Water' schema: $ref: '#/components/schemas/Water' description: OK 404: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Water with given Id not found summary: Represents a water tags: - waters x-openapi-router-controller: openapi_server.controllers.waters_controller components: examples: User: value: username: jane email: jane@example.org firstName: Jane lastName: Doe activated: true apiKeys: - ApiKey4701 UserCreation: value: username: richard email: richard@examle.org firstName: Richard lastName: Roe password: sdfl.1238_ASDkeil? Water: summary: A water example object value: waterId: 1 name: Mississippi osmId: 1756854 osmType: R WaterCreation: summary: A water example object for creation of a water value: name: Mississippi osmId: 1756854 osmType: Relation waters: summary: A sample list with waters value: - waterId: 1 name: Mississippi osmId: 1756854 osmType: Relation - waterId: 2 name: Bodensee HttpError: value: code: 404 message: Water with id 999999 not found parameters: orderBy: description: 'Order by field: name' explode: true in: query name: orderBy required: false schema: default: name example: name type: string style: form order: description: Order explode: true in: query name: order required: false schema: $ref: '#/components/schemas/order' style: form offset: description: Skip over a number of elements by specifying an offset value for the query explode: true in: query name: offset required: false schema: default: 0 example: 0 format: int32 type: integer style: form limit: description: Limit the number of elements on the response explode: true in: query name: limit required: false schema: default: 10 example: 10 format: int32 type: integer style: form responses: BadRequest: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Bad Request (400) Unauthorized: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Unauthorized (401) acces to resource NotFound: content: application/json: examples: HttpError: $ref: '#/components/examples/HttpError' schema: $ref: '#/components/schemas/HttpError' description: Water with given Id not found schemas: username: title: Username type: string apiKey: title: API Key type: string apiKeys: items: $ref: '#/components/schemas/apiKey' title: Array of API keys type: array activationCode: title: Activation code for a User type: string itemId: format: int32 title: Item ID type: integer itemName: title: Item Name type: string osmType: enum: - Node - Way - Relation title: OSM type of item (N|W|R) type: string User: example: firstName: firstName lastName: lastName apiKeys: - null - null email: email username: username activated: true properties: username: title: Username type: string email: type: string firstName: type: string lastName: type: string activated: type: boolean apiKeys: items: $ref: '#/components/schemas/apiKey' title: Array of API keys type: array title: User type: object UserCreation: example: firstName: firstName lastName: lastName password: password email: email username: username properties: username: title: Username type: string email: type: string firstName: type: string lastName: type: string password: type: string required: - email - firstName - lastName - password - username title: User type: object Water: example: manager: manager osmId: 6 name: name waterId: 0 properties: waterId: format: int32 title: Item ID type: integer name: title: Item Name type: string manager: title: Username type: string osmId: format: int32 title: Item ID type: integer osmType: $ref: '#/components/schemas/osmType' required: - name - waterId title: Water type: object WaterCreation: example: osmId: 0 name: name properties: name: title: Item Name type: string osmId: format: int32 title: Item ID type: integer osmType: $ref: '#/components/schemas/osmType' required: - name title: Water type: object waters: items: $ref: '#/components/schemas/Water' title: waters type: array order: default: asc description: | Sort order: * `asc` - Ascending, from A to Z * `desc` - Descending, from Z to A enum: - desc - asc example: asc title: order type: string HttpError: properties: code: format: int32 type: integer message: type: string required: - code - message title: HTTP Error Response Object type: object securitySchemes: basicAuth: scheme: basic type: http x-basicInfoFunc: openapi_server.server_impl.security.Security.auth_basic apiKeyAuth: in: header name: X-API-KEY type: apiKey x-apikeyInfoFunc: openapi_server.server_impl.security.Security.auth_api