{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "device_iot": {
      "type": "object",
      "properties": {
        "cat": {
          "type": "integer"
        },
        "cby": {
          "type": "string"
        },
        "tid": {
          "type": "string"
        }
      },
      "required": [
        "tid",
        "cby",
        "cat"
      ]
    },
    "device_org_id": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "string"
        }
      },
      "required": [
        "ref"
      ]
    },
    "deviceTest": {
      "allOf": [
        {
          "$ref": "#/definitions/device"
        },
        {
          "properties": {
            "test": {
              "type": "string"
            }
          }
        }
      ],
      "type": "object"
    },
    "device_location": {
      "id": "/properties/location",
      "type": "object",
      "properties": {
        "coordinates": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "coordinates"
      ]
    },
    "device": {
      "location": {
        "$ref": "#/definitions/device_location"
      },
      "type": "object",
      "properties": {
        "lbl": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    }
  },
  "allOf": [
    {
      "$ref": "#/definitions/deviceTest"
    }
  ]
}