#%RAML 0.8
title: Door State
version: v1.0.0-20170918
schemas:
- Contact: |
    {
      "id": "http://openinterconnect.org/schemas/x.com.st.doorstate.json#",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Door State",
      "definitions": {
        "x.com.st.doorstate": {
          "type": "object",
          "properties": {
            "value": {
              "type": "boolean",
              "description": "ReadOnly, true = sensed, false = not sensed."
            }
          }
        }
      },
      "type": "object",
      "allOf": [
        {"$ref": "oic.core.json#/definitions/oic.core"},
        {"$ref": "oic.baseResource.json#/definitions/oic.r.baseResource"},
        {"$ref": "#/definitions/x.com.st.doorstate"}
      ],
      "required": ["value"]
    }
traits:
  - interface:
      queryParameters:
        if:
          enum: ["oic.if.s"]

/DoorStateResURI:
  description: |
    This resource describes whether a door state has been tripped or not.
    Typical use case is in Security Systems detecting door open.
    The value is a boolean.
    A value of True means that door has been opened.
    A value of False means that door has been closed.
  displayName: Door State
  is: [ interface ] # valid for all methods

  get:
    responses:
      200:
        body:
          application/json:
            schema: Contact
            example: |
              {
                "rt":     "x.com.st.doorstate",
                "id":     "unique_example_id",
                "value":  true
              }
