#%RAML 0.8
title: WWST Odor sensor level
version: v1.0.0-20170911
schemas:
- OdorLevel: |
    {
      "id": "http://openinterconnect.org/iotdatamodels/schemas/x.com.st.gaslevel.json#",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.",
      "title": "Order sensor level",
      "definitions": {
        "x.com.st.gaslevel": {
          "type": "object",
          "properties": {
            "odorLevel": {
              "type": "number",
              "description": "A value representation of gas level, usually 0-5"
            },
            "range": {
              "type": "array",
              "description": "Array defining min,max values for this gas level on this device",
              "items": {
                "type": "number"
              },
              "readOnly": true
            }
          }
        }
      },
      "type": "object",
      "allOf": [
        {
          "$ref": "oic.baseResource.json#/definitions/oic.r.baseresource"
        },
        {
          "$ref": "#/definitions/x.com.st.gaslevel"
        }
      ],
      "required": [
        "odorLevel"
      ]
    }

traits:
  - interface:
      queryParameters:
        if:
          enum: ["oic.if.s","oic.if.baseline"]

/WWSTOrderSensorResURI:
  description: |
      Odor sensor level
  displayName: WWST Odor sensor level
  is: [ interface ]

  get:
    responses:
      200:
        body:
          application/json:
            schema: OdorLevel
            example: |
              {
                "rt":["x.com.st.gaslevel"],
                "id":"unique_example_id",
                "odorLevel":  2,
                "range":        [0,5]
              }
