Ignore:
Timestamp:
Oct 20, 2019, 6:22:29 PM (7 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
6b713e6
Parents:
ec8d5d0
Message:

Fixed HttpError responses by mapservice (switched to connexion.ProblemException Api)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mapservice/openapi.yaml

    rec8d5d0 r1cd45dd  
    377377        '404':
    378378          $ref: '#/components/responses/NotFound'
    379   '/devices':
     379  /devices:
    380380    get:
    381381      description: Returns all devices of user
    … …  
    417417        - basicAuth: []
    418418        - apiKeyAuth: []
    419       parameters:
    420         - name: user_id
    421           in: path
    422           description: User ID
    423           required: true
    424           schema:
    425             $ref: '#/components/schemas/itemId'
    426419      requestBody:
    427420        content:
    … …  
    430423              $ref: '#/components/schemas/DeviceCreation'
    431424            example:
    432               name: "Lovely Boat"
     425              name: Lovely Boat
    433426              sensorDepth: 2
    434427      responses:
    … …  
    473466                Water:
    474467                  $ref: '#/components/examples/Device'
     468        '404':
     469          $ref: '#/components/responses/NotFound'
     470    delete:
     471      description: Deletes given device and returns remaining devices of the user
     472      tags:
     473        - devices
     474      summary: Deletes device
     475      operationId: devicesDeviceDelete
     476      security:
     477        - basicAuth: []
     478        - apiKeyAuth: []
     479      parameters:
     480        - name: id
     481          in: path
     482          description: Item id
     483          required: true
     484          schema:
     485            $ref: '#/components/schemas/itemId'
     486          example: 1
     487      responses:
     488        '200':
     489          description: OK
     490          content:
     491            application/json:
     492              schema:
     493                $ref: '#/components/schemas/devices'
     494              example:
     495                Devices:
     496                  $ref: '#/components/examples/devices'
     497        '400':
     498          $ref: '#/components/responses/BadRequest'
     499        '401':
     500          $ref: '#/components/responses/Unauthorized'
    475501        '404':
    476502          $ref: '#/components/responses/NotFound'
    … …  
    555581    sensorDepth:
    556582      type: number
    557       title: 'Depth of sensor beneath water level in cm (positive means below water)'
     583      title: Depth of sensor beneath water level in cm (positive means below water)
    558584      minimum: 0
    559585    User:
    … …  
    704730          $ref: '#/components/schemas/sensorDepth'
    705731        comment:
    706               $ref: '#/components/schemas/comment'
     732          $ref: '#/components/schemas/comment'
    707733      required:
    708734        - deviceId
    … …  
    718744          $ref: '#/components/schemas/sensorDepth'
    719745        comment:
    720               $ref: '#/components/schemas/comment'
     746          $ref: '#/components/schemas/comment'
    721747      required:
    722748        - name
    … …  
    731757      type: object
    732758      properties:
    733         code:
    734           type: integer
    735         message:
    736           type: string
     759        type:
     760            type: string
     761        title:
     762            type: string
     763        detail:
     764            type: string
     765        instance:
     766            type: string
    737767      required:
    738         - code
    739         - message
     768        - type
     769        - title
     770        - detail
     771        - instance
    740772  parameters:
    741773    orderBy:
    … …  
    873905    HttpError:
    874906      value:
    875         code: 404
    876         message: Water with id 999999 not found
     907        type: "http://example.com/waters/not-found"
     908        title: "Water 1 not found"
     909        detail: "There is no water with id 1 in database"
     910        instance: "http://example.net/waters/1"
    877911  responses:
    878912    BadRequest:
    879913      description: Bad Request (400)
    880914      content:
    881         application/json:
     915        application/problem+json:
    882916          schema:
    883917            $ref: '#/components/schemas/HttpError'
    … …  
    888922      description: Unauthorized (401) acces to resource
    889923      content:
    890         application/json:
     924        application/problem+json:
    891925          schema:
    892926            $ref: '#/components/schemas/HttpError'
    … …  
    897931      description: Water with given Id not found
    898932      content:
    899         application/json:
     933        application/problem+json:
    900934          schema:
    901935            $ref: '#/components/schemas/HttpError'
Note: See TracChangeset for help on using the changeset viewer.