Ignore:
Timestamp:
May 25, 2019, 5:40:08 PM (8 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
70f328b
Parents:
28198a1
git-author:
Joachim Langenbach <joachim.langenbach@…> (05/22/19 18:20:13)
git-committer:
Joachim Langenbach <joachim.langenbach@…> (05/25/19 17:40:08)
Message:

Gauges could be added now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mapservice/openapi.yaml

    r28198a1 r13cbe66  
    8181          description: CORS prefilght requests should return 200 as status code
    8282          content:
    83            application/json: {}
     83            application/json: {}
    8484  '/user/apikey_create':
    8585    get:
    … …  
    9898              schema:
    9999                $ref: '#/components/schemas/apiKeys'
    100               example: 'NewApiKey4711'
     100              example: NewApiKey4711
    101101        '400':
    102102          $ref: '#/components/responses/BadRequest'
    … …  
    119119          schema:
    120120            $ref: '#/components/schemas/apiKey'
    121           example: 'DelApiKey4711'
     121          example: DelApiKey4711
    122122      responses:
    123123        '200':
    … …  
    127127              schema:
    128128                $ref: '#/components/schemas/apiKeys'
    129               example: 'ApiKey4711'
     129              example: ApiKey4711
    130130        '400':
    131131          $ref: '#/components/responses/BadRequest'
    132132        '401':
    133133          $ref: '#/components/responses/Unauthorized'
     134        '404':
     135          $ref: '#/components/responses/NotFound'
    134136  '/user/activate/{activation_code}':
    135137    get:
    … …  
    146148          schema:
    147149            $ref: '#/components/schemas/activationCode'
    148           example: 'dac9630aec642a428cd73f4be0a03569'
     150          example: dac9630aec642a428cd73f4be0a03569
    149151      responses:
    150152        '302':
    … …  
    154156              schema:
    155157                type: string
    156               description: URL to the website, showing the result of the activation
    157   /waters:
     158              description: 'URL to the website, showing the result of the activation'
     159  '/waters':
    158160    get:
    159161      description: Returns all waters
    … …  
    167169          schema:
    168170            $ref: '#/components/schemas/itemName'
    169           example: 'Missi'
     171          example: Missi
    170172        - name: manager
    171173          in: query
    172174          schema:
    173175            $ref: '#/components/schemas/username'
    174           example: 'jane'
     176          example: jane
    175177        - $ref: '#/components/parameters/orderBy'
    176178        - $ref: '#/components/parameters/offset'
    … …  
    186188                Waters:
    187189                  $ref: '#/components/examples/waters'
     190        '404':
     191          $ref: '#/components/responses/NotFound'
    188192    post:
    189193      description: Adds a new water to the database
    … …  
    200204            schema:
    201205              $ref: '#/components/schemas/WaterCreation'
    202             example: 
     206            example:
    203207              name: Rhein
    204208              osmId: 1756854
    205               osmType: 'Relation'
     209              osmType: Relation
    206210      responses:
    207211        '201':
    … …  
    224228        - waters
    225229      summary: Represents a water
    226       operationId: waterGetById
     230      operationId: watersGetById
    227231      parameters:
    228232        - name: id
    … …  
    242246                Water:
    243247                  $ref: '#/components/examples/Water'
     248        '404':
     249          $ref: '#/components/responses/NotFound'
     250  '/waters/{water_id}/gauges':
     251    get:
     252      description: Returns all gauges of water waterId
     253      tags:
     254        - waters
     255      summary: Find gauges of water waterId by gaugeId
     256      operationId: watersGaugesGet
     257      parameters:
     258        - name: water_id
     259          in: path
     260          description: Water ID
     261          required: true
     262          schema:
     263            $ref: '#/components/schemas/itemId'
     264        - name: name
     265          in: query
     266          schema:
     267            $ref: '#/components/schemas/itemName'
     268          example: Missi
     269        - name: manager
     270          in: query
     271          schema:
     272            $ref: '#/components/schemas/username'
     273          example: jane
     274        - $ref: '#/components/parameters/orderBy'
     275        - $ref: '#/components/parameters/offset'
     276        - $ref: '#/components/parameters/limit'
     277      responses:
     278        '200':
     279          description: OK
     280          content:
     281            application/json:
     282              schema:
     283                $ref: '#/components/schemas/Gauges'
     284              examples:
     285                Gauges:
     286                  $ref: '#/components/examples/Gauges'
     287            application/geo+json:
     288              schema:
     289                $ref: '#/components/schemas/GaugesGeoJson'
     290              examples:
     291                Gauge:
     292                  $ref: '#/components/examples/GaugesGeoJson'
     293    post:
     294      description: Adds a new gauge for water waterId to the database
     295      tags:
     296        - waters
     297      summary: Add a new water
     298      operationId: watersGaugeCreate
     299      parameters:
     300        - name: water_id
     301          in: path
     302          description: Water ID
     303          required: true
     304          schema:
     305            $ref: '#/components/schemas/itemId'
     306      security:
     307        - basicAuth: []
     308        - apiKeyAuth: []
     309      requestBody:
     310        content:
     311          application/json:
     312            schema:
     313              $ref: '#/components/schemas/GaugeCreation'
     314            example:
     315              name: New Orleans
     316              location:
     317                - 90.136111
     318                - 29.934722
     319      responses:
     320        '201':
     321          description: Gauge created
     322          content:
     323            application/json:
     324              schema:
     325                $ref: '#/components/schemas/Gauge'
     326              examples:
     327                Gauge:
     328                  $ref: '#/components/examples/Gauge'
     329            application/geo+json:
     330              schema:
     331                $ref: '#/components/schemas/GaugeGeoJson'
     332              examples:
     333                Gauge:
     334                  $ref: '#/components/examples/GaugeGeoJson'
     335        '400':
     336          $ref: '#/components/responses/BadRequest'
     337        '401':
     338          $ref: '#/components/responses/Unauthorized'
     339  '/waters/{water_id}/gauges/{gauge_id}':
     340    get:
     341      description: Returns the gauge identified by id
     342      tags:
     343        - waters
     344      summary: Represents a gauge
     345      operationId: watersGaugeGetById
     346      parameters:
     347        - name: water_id
     348          in: path
     349          description: Water ID
     350          required: true
     351          schema:
     352            $ref: '#/components/schemas/itemId'
     353        - name: gauge_id
     354          in: path
     355          description: Gauge ID
     356          required: true
     357          schema:
     358            $ref: '#/components/schemas/itemId'
     359      responses:
     360        '200':
     361          description: OK
     362          content:
     363            application/json:
     364              schema:
     365                $ref: '#/components/schemas/Gauge'
     366              examples:
     367                Gauge:
     368                  $ref: '#/components/examples/Gauge'
     369            application/geo+json:
     370              schema:
     371                $ref: '#/components/schemas/GaugeGeoJson'
     372              examples:
     373                Gauge:
     374                  $ref: '#/components/examples/GaugeGeoJson'
     375        '400':
     376          $ref: '#/components/responses/BadRequest'
    244377        '404':
    245378          $ref: '#/components/responses/NotFound'
    … …  
    277410      title: Item Name
    278411      type: string
     412    order:
     413      title: order
     414      enum:
     415        - desc
     416        - asc
     417      type: string
     418      default: asc
     419      description: |
     420        Sort order:
     421          * `asc` - Ascending, from A to Z
     422          * `desc` - Descending, from Z to A
     423      example: asc
    279424    osmType:
    280425      title: OSM type of item (N|W|R)
    … …  
    284429        - Way
    285430        - Relation
     431    comment:
     432      title: Comment of an item
     433      type: string
     434    point:
     435      title: 'Point of type [longitude, latitude]'
     436      type: array
     437      maxItems: 2
     438      minItems: 2
     439      items:
     440        type: number
     441    geoJsonType:
     442      title: Type of GeoJSON objects
     443      type: string
     444      enum:
     445        - Feature
     446        - Point
     447    geoJsonPoint:
     448      type: object
     449      description: GeoJSon geometry
     450      externalDocs:
     451        url: 'http://geojson.org/geojson-spec.html#id2'
     452      properties:
     453        type:
     454          type: string
     455        coordinates:
     456          $ref: '#/components/schemas/point'
    286457    User:
    287458      title: User
    … …  
    334505        osmType:
    335506          $ref: '#/components/schemas/osmType'
     507        gauges:
     508          $ref: '#/components/schemas/Gauges'
    336509      required:
    337510        - waterId
    … …  
    354527      items:
    355528        $ref: '#/components/schemas/Water'
    356     order:
    357       title: order
    358       enum:
    359         - desc
    360         - asc
    361       type: string
    362       default: asc
    363       description: |
    364         Sort order:
    365           * `asc` - Ascending, from A to Z
    366           * `desc` - Descending, from Z to A
    367       example: asc
     529    Gauge:
     530      title: Gauge
     531      type: object
     532      properties:
     533        gaugeId:
     534          $ref: '#/components/schemas/itemId'
     535        name:
     536          $ref: '#/components/schemas/itemName'
     537        manager:
     538          $ref: '#/components/schemas/username'
     539        location:
     540          $ref: '#/components/schemas/point'
     541        comment:
     542          $ref: '#/components/schemas/comment'
     543      required:
     544        - gaugeId
     545        - name
     546        - location
     547    GaugeCreation:
     548      title: Gauge for Creation
     549      type: object
     550      properties:
     551        name:
     552          $ref: '#/components/schemas/itemName'
     553        location:
     554          $ref: '#/components/schemas/point'
     555        comment:
     556          $ref: '#/components/schemas/comment'
     557      required:
     558        - name
     559        - location
     560    Gauges:
     561      title: Gauges
     562      type: array
     563      items:
     564        $ref: '#/components/schemas/Gauge'
     565    GaugeGeoJson:
     566      title: Gauge
     567      type: object
     568      properties:
     569        type:
     570          $ref: '#/components/schemas/geoJsonType'
     571        geometry:
     572          $ref: '#/components/schemas/geoJsonPoint'
     573        properties:
     574          type: object
     575          properties:
     576            name:
     577              $ref: '#/components/schemas/itemName'
     578            manager:
     579              $ref: '#/components/schemas/username'
     580            comment:
     581              $ref: '#/components/schemas/comment'
     582          required:
     583            - name
     584      required:
     585        - type
     586        - geometry
     587        - properties
     588    GaugesGeoJson:
     589      title: Gauges in GeoJson format
     590      type: array
     591      items:
     592        $ref: '#/components/schemas/GaugeGeoJson'
    368593    HttpError:
    369594      title: HTTP Error Response Object
    … …  
    385610        type: string
    386611        default: name
    387         example: 'name'
     612        example: name
    388613    order:
    389614      name: order
    … …  
    443668        name: Mississippi
    444669        osmId: 1756854
    445         osmType: 'Relation'
     670        osmType: Relation
    446671      summary: A water example object for creation of a water
    447672    waters:
    448673      value:
    449674        - waterId: 1
    450           name: 'Mississippi'
     675          name: Mississippi
    451676          osmId: 1756854
    452           osmType: 'Relation'
     677          osmType: Relation
    453678        - waterId: 2
    454           name: 'Bodensee'
     679          name: Bodensee
    455680      summary: A sample list with waters
     681    Gauge:
     682      value:
     683        gaugeId: 1
     684        name: New Orleans
     685        manager: jane
     686        location:
     687          - 90.136111
     688          - 29.934722
     689        comment: Gauge for Mississippi in New Orleans
     690    Gauges:
     691      value:
     692        - gaugeId: 1
     693          name: New Orleans
     694          manager: jane
     695          location:
     696            - 90.136111
     697            - 29.934722
     698      summary: A sample list of gauges
     699    GaugeGeoJson:
     700      value:
     701        type: Feature
     702        geometry:
     703          type: Point
     704          coordinates:
     705            - 90.136111
     706            - 29.934722
     707          properties:
     708            name: New Orleans
     709            manager: jane
     710            comment: Gauge for Mississippi in New Orleans
     711    GaugesGeoJson:
     712      value:
     713        - type: Feature
     714          geometry:
     715            type: Point
     716            coordinates:
     717              - 90.136111
     718              - 29.934722
     719            properties:
     720              name: New Orleans
     721              manager: jane
     722              comment: Gauge for Mississippi in New Orleans
     723      summary: A sample list of gauges in GeoJson format
    456724    HttpError:
    457725      value:
    … …  
    492760      Sea)
    493761  - name: users
    494     description: >-
    495       All actions used to manage users and api keys
     762    description: All actions used to manage users and api keys
Note: See TracChangeset for help on using the changeset viewer.