fix incorrect extensino

fix incorrect extensino

swagger: '2.0'
info:
  description: >-
    This is Citadel, a city-scale data hub. You can interact with Citadel to
    store/retrieve city data in a unified way in a safe way.
  version: 0.0.1
  title: Citadel
  contact:
    email: jbkoh@ucsd.edu
  license:
    name: Apache 2.0
    url: 'https://github.com/MetroInsight/citadel/blob/master/LICENSE'
host: xxx.yyyy.io
basePath: /api
tags:
  - name: metadata
    description: Contextual information of data points.
  - name: data
    description: >-
      Spatio-temporal data interface. Its contextual information is stored as
      metadata.
schemes:
  - http
paths:
  /point:
    post:
      tags:
        - metadata
      summary: Add a Point.
      description: ''
      operationId: createPoint
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          description: >-
            Metadata of a point to make. The name should be unique in the
            system.
          required: true
          schema:
            $ref: '#/definitions/Metadata'
      responses:
        '200':
          description: successful creation
        '400':
          description: Various reasons.
  '/point/{uuid}':
    get:
      tags:
        - metadata
      summary: Get metadata corresponding to a UUID.
      description: Get metadata corresponding to a UUID.
      operationId: getPoint
      produces:
        - application/json
      parameters:
        - name: uuid
          in: path
          description: UUID of a Point
          required: true
          type: string
      responses:
        '200':
          description: Get Point's metadata object.
          schema:
            $ref: '#/definitions/Metadata'
        '400':
          description: Various reasons.
        '404':
          description: Point not found (TODO)
  /query:
    post:
      tags:
        - metadata
      summary: Query points matching given tag-value pairs.
      description: Query points matching given tag-value pairs.
      operationId: queryPoint
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          description: >-
            Metadata of a point to make. The name should be unique in the
            system.
          required: true
          schema:
            $ref: '#/definitions/MetadataQuery'
      responses:
        '200':
          description: Get Point's metadata object.
          schema:
            $ref: '#/definitions/MetadataResult'
        '400':
          description: Various reasons.
        '404':
          description: Point not found (TODO)
  /data:
    post:
      tags:
        - data
      summary: Push data
      description: Pushing given spatio-temporal data.
      operationId: insertData
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          description: List of data.
          required: true
          schema:
            $ref: '#/definitions/Data'
      responses:
        '200':
          description: successful push
        '400':
          description: Various reasons.
  /querydata:
    post:
      tags:
        - data
      summary: Spatio-temporal Query for Data
      description: 'Data query based on i) Bounding box, ii) time range, and iii) UUIDs'
      operationId: queryData
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          description: ''
          required: true
          schema:
            $ref: '#/definitions/DataQuery'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DataResult'
        '400':
          description: Various reasons.
definitions:
  Metadata:
    type: object
    required:
      - name
      - pointType
    properties:
      name:
        type: string
        example: mySensor1
      pointType:
        type: string
        example: temperature
      unit:
        type: string
        example: DEG_F
  MetadataQuery:
    type: object
    properties:
      query:
        type: object
        properties:
          name:
            type: string
            example: mySensor1 (optional)
          pointType:
            type: string
            example: temperature (optional)
          unit:
            type: string
            example: DEG_F (optional)
  MetadataResult:
    type: object
    properties:
      results:
        type: array
        items:
          type: string
        example:
          - UUID_1
          - UUID_2
      success:
        type: boolean
      reason:
        type: string
  Datum:
    type: object
    properties:
      uuid:
        type: string
        example: UUID_1
      timestamp:
        type: integer
        example: 1511046384000
        description: UNIX timestamp in microseconds.
      geometryType:
        type: string
        example: point
        description: 'One of "point", "line", and "polygon"'
      coordinates:
        type: array
        items:
          type: array
          items:
            type: number
        example:
          - - -117.231778
            - 32.882319
      value:
        type: number
        example: '71.0'
  Data:
    type: array
    items:
      $ref: '#/definitions/Datum'
  DataQuery:
    type: object
    properties:
      lat_min:
        type: number
        example: 32.88231
      lat_max:
        type: number
        example: 32.88232
      lng_min:
        type: number
        example: -117.23178
      lng_max:
        type: number
        example: -117.23177
      timestamp_min:
        type: integer
        example: 1511046284000
      timestamp_max:
        type: integer
        example: 1511046584000
      uuids:
        type: array
        items:
          type: string
        example:
          - UUID_1
          - UUID_2
  DataResult:
    type: object
    properties:
      results:
        $ref: '#/definitions/Data'
      success:
        type: boolean
      reason:
        type: string
externalDocs:
  description: Find out more about Citadel and MetroInsight
  url: 'https://metroinsight.io'


Added option for returning GeoJSON response

#%RAML 1.0
title: Digitale Delta - API
version: 2.0
securitySchemes:
  basic:
    type: Basic Authentication
  openidconnect:
    type: OAuth 2.0
baseUri: http://api.rws.nl/dl/
mediaType: [ application/json ]
description: Digital Delta API version 2.0
documentation:
 - title: Introduction
   content: !include Documentation/Introduction.md
 - title: Document history
   content: !include Documentation/Document_History.md
 - title: The API specification
   content: !include Documentation/The_API_Specification.md
 - title: Future enhancements and research
   content: !include Documentation/Future_Enhancements_and_Research.md

# HTTP is included as protocol but is optional as for security reasons a Provider might decide to support HTTPS only.
protocols:
  - HTTP
  - HTTPS

uses:
  DD-T: /Libraries/dd-base-types.raml
  GENERIC-RESP: /Libraries/generic-response-types.raml
  DD-RESP: /Libraries/dd-response-types.raml
  TRAITS: /Libraries/dd-traits.raml

#
# All data types are defined in external files (see above) so they can be shared between DD and DD-OPER API.
#
types:

#
# The resources
/dd/2.0:

# ##################################################

  /nodes:
    description: The Nodes endpoint returns the nodes that the provider offers.
    get:
      is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        name?:
          type: string
          description: (Partial) name of the node. Partional meaning startsWith(...).
          example: AquaDeskPrimaryNode
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.NodeListResponse
              example: !include examples/dd-nodelist-response.json
    /{nodeId}:
      description: Request a specific Node by its unique dentifier.
      uriParameters:
        nodeId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.NodeResponse
                example: !include examples/dd-node-response.json

# ##################################################

  /sources:
    description: Retrieve (data)source resources.
    is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
    get:
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.SourceListResponse
              example: !include examples/dd-sourcelist-response.json

# #####################################################

  /locations:
    get:
      description: |
        Retrieve location resources.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        boundingBox?:
          type: DD-T.BoundingBox
          example: [4.8, 52.0, 5.8, 54.0]
        locationName?:
          type: string
          description: (Partial) location name. Partional meaning startsWith(...).
          example: NEDHMT
        nodeId?:
          type: DD-T.Identifier
          description: This query parameter is deprecated.
        locationCode?:
          type: string
          description: Location code.
          example: NLWATB-RWTS_AFGDM_0001
        locationId?: DD-T.Identifier
        format?:
          type: string
          description: Specification of the requested response format. Default is "json".
            By specifying "format=geojson", a pure GeoJSON response is returned (i.e. a FeatureCollection, without provider information and paging links).
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.LocationListResponse
              example: !include examples/dd-locationslist-response.json

    /{locationId}:
      description: Request a specific location by its id.
      uriParameters:
        locationId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: |
          Request a specific Location by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
          format?:
            type: string
            description: Specification of the requested response format. Default is "json".
              By specifying "format=geojson", a pure GeoJSON response is returned (i.e. a FeatureCollection, without provider information and paging links).
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.LocationResponse
                example: !include examples/dd-location-response.json

######################################################

  /aspectSets:
    description:
      Retrieves available aspect sets.
      Note - The request requires some parameters to provide a context for the response as aspects relate to observation types for instance.
      When aspects and aspect sets are not supported and empty List shall be returned.
    get:
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError  ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.AspectSetListResponse
              example: !include examples/dd-aspectsetlist-response.json

######################################################

  /observationTypes:
    description: The ObservationTypes endpoint can return the observationtypes that the provider offers. Filtering: list of parameters.

About ObservationType

The ObservationType objects describe all attributes to correctly interpret what has been measured, and in what way. It is essential to have the quantity field.

    get:
      description: |
        Retrieve observationTypes resources.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        observationTypeId?:
          type: DD-T.Identifier
        quantity?:
          description: Retrieve only observation types that contain the specified quantity.
          type: string
        parameterCode?:
          description: Retrieve only observation types that contain the specified parameter code.
          type: string
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.ObservationTypeListResponse
              example: !include examples/dd-observationtypelist-response.json

    /{observationTypeId}:
      description: Request a specific ObservationType by its unique identifier.
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      uriParameters:
        observationTypeId:
          type: DD-T.Identifier
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.ObservationTypeResponse
                example: !include examples/dd-observationtype-response.json

######################################################

  /timeseries:
    get:
      description: |
        Retrieve timeseries resources.
        A request where both startTime and endTime are omitted returns a response with just the metadata (implicit includeMetaData = true).
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.timeseriesFilterable, TRAITS.locationFilterable, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        startTime?:
          type: DD-T.StartTime
        endTime?:
          type: DD-T.EndTime
        locationCode?:
          type: string
          example: "HVH"
        locationName?:
          type: DD-T.LocationName
          example: "Hoek.vanHolland.nieuwewat"
        sourceName:
          type: DD-T.SourceName
          example: rws_prediction
        observationTypeId?:
          type: DD-T.Identifier
        realizationCount?:
          description: ??? Added Count as this is the name in ObservationType response.
          type: integer
        parameterCode?:
          type: string
        quantity:
          description:
          type: string
        aspectSet?:
          type: DD-T.AspectSetName
        quantityName?:
          type: DD-T.QuantityName
        includeMetaData?:
          description: This url query parameter replaces the '/data' control extension of the /timeseries endpoint.
            Metadata is included in the response by default, but can be excluded to reduce response size.
          type: boolean
          default: true
        intervalLength?:
           type: DD-T.IntervalLength
        nodeId?:
          type: DD-T.Identifier
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.TimeseriesListResponse
              example: !include examples/dd-timeserieslist-response-verwachtingen-en-metingen-fulldd.json

    /{timeseriesId}:
      description: Request a specific (single) Timeseries by its unique identifier.
      uriParameters:
        timeseriesId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.TimeseriesResponse
                example: !include examples/dd-timeseries-response-single.json

#%RAML 1.0
title: Digitale Delta - API
version: 2.0
securitySchemes:
  basic:
    type: Basic Authentication
  openidconnect:
    type: OAuth 2.0
baseUri: http://api.rws.nl/dl/
mediaType: [ application/json ]
description: Digital Delta API version 2.0
documentation:
 - title: Introduction
   content: !include Documentation/Introduction.md
 - title: Document history
   content: !include Documentation/Document_History.md
 - title: The API specification
   content: !include Documentation/The_API_Specification.md
 - title: Future enhancements and research
   content: !include Documentation/Future_Enhancements_and_Research.md

# HTTP is included as protocol but is optional as for security reasons a Provider might decide to support HTTPS only.
protocols:
  - HTTP
  - HTTPS

uses:
  DD-T: /Libraries/dd-base-types.raml
  GENERIC-RESP: /Libraries/generic-response-types.raml
  DD-RESP: /Libraries/dd-response-types.raml
  TRAITS: /Libraries/dd-traits.raml

#
# All data types are defined in external files (see above) so they can be shared between DD and DD-OPER API.
#
types:

#
# The resources
/dd/2.0:

# ##################################################

  /nodes:
    description: The Nodes endpoint returns the nodes that the provider offers.
    get:
      is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        name?:
          type: string
          description: (Partial) name of the node. Partional meaning startsWith(...).
          example: AquaDeskPrimaryNode
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.NodeListResponse
              example: !include examples/dd-nodelist-response.json
    /{nodeId}:
      description: Request a specific Node by its unique dentifier.
      uriParameters:
        nodeId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.NodeResponse
                example: !include examples/dd-node-response.json

# ##################################################

  /sources:
    description: Retrieve (data)source resources.
    is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
    get:
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.SourceListResponse
              example: !include examples/dd-sourcelist-response.json

# #####################################################

  /locations:
    get:
      description: |
        Retrieve location resources.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        boundingBox?:
          type: DD-T.BoundingBox
          example: [4.8, 52.0, 5.8, 54.0]
        locationName?:
          type: string
          description: (Partial) location name. Partional meaning startsWith(...).
          example: NEDHMT
        nodeId?:
          type: DD-T.Identifier
          description: This query parameter is deprecated.
        locationCode?:
          type: string
          description: Location code.
          example: NLWATB-RWTS_AFGDM_0001
        locationId?: DD-T.Identifier
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.LocationListResponse
              example: !include examples/dd-locationslist-response.json

    /{locationId}:
      description: Request a specific location by its id.
      uriParameters:
        locationId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: |
          Request a specific Location by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.LocationResponse
                example: !include examples/dd-location-response.json

######################################################

  /aspectSets:
    description:
      Retrieves available aspect sets.
      Note - The request requires some parameters to provide a context for the response as aspects relate to observation types for instance.
      When aspects and aspect sets are not supported and empty List shall be returned.
    get:
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError  ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.AspectSetListResponse
              example: !include examples/dd-aspectsetlist-response.json

######################################################

  /observationTypes:
    description: The ObservationTypes endpoint can return the observationtypes that the provider offers. Filtering: list of parameters.

About ObservationType

The ObservationType objects describe all attributes to correctly interpret what has been measured, and in what way. It is essential to have the quantity field.

    get:
      description: |
        Retrieve observationTypes resources.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        observationTypeId?:
          type: DD-T.Identifier
        quantity?:
          description: Retrieve only observation types that contain the specified quantity.
          type: string
        parameterCode?:
          description: Retrieve only observation types that contain the specified parameter code.
          type: string
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.ObservationTypeListResponse
              example: !include examples/dd-observationtypelist-response.json

    /{observationTypeId}:
      description: Request a specific ObservationType by its unique identifier.
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      uriParameters:
        observationTypeId:
          type: DD-T.Identifier
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.ObservationTypeResponse
                example: !include examples/dd-observationtype-response.json

######################################################

  /timeseries:
    get:
      description: |
        Retrieve timeseries resources.
        A request where both startTime and endTime are omitted returns a response with just the metadata (implicit includeMetaData = true).
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.timeseriesFilterable, TRAITS.locationFilterable, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        startTime?:
          type: DD-T.StartTime
        endTime?:
          type: DD-T.EndTime
        locationCode?:
          type: string
          example: "HVH"
        locationName?:
          type: DD-T.LocationName
          example: "Hoek.vanHolland.nieuwewat"
        sourceName:
          type: DD-T.SourceName
          example: rws_prediction
        observationTypeId?:
          type: DD-T.Identifier
        realizationCount?:
          description: ??? Added Count as this is the name in ObservationType response.
          type: integer
        parameterCode?:
          type: string
        quantity:
          description:
          type: string
        aspectSet?:
          type: DD-T.AspectSetName
        quantityName?:
          type: DD-T.QuantityName
        includeMetaData?:
          description: This url query parameter replaces the '/data' control extension of the /timeseries endpoint.
            Metadata is included in the response by default, but can be excluded to reduce response size.
          type: boolean
          default: true
        intervalLength?:
           type: DD-T.IntervalLength
        nodeId?:
          type: DD-T.Identifier
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.TimeseriesListResponse
              example: !include examples/dd-timeserieslist-response-verwachtingen-en-metingen-fulldd.json

    /{timeseriesId}:
      description: Request a specific (single) Timeseries by its unique identifier.
      uriParameters:
        timeseriesId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.TimeseriesResponse
                example: !include examples/dd-timeseries-response-single.json