{
  "$id": "https://waku-robotics.com/schema/error",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Device Errors",
  "type": "object",
  "required": ["timestamp"],
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp in ISO8601 format (YYYY-MM-DDTHH:mm:ss.ssZ).",
      "examples": ["1991-03-11T11:40:03.12Z"]
    },
    "activeErrors": {
      "type": "array",
      "items": { "$ref": "#/$defs/error" }
    }
  },
  "$defs": {
    "error": {
      "type": "object",
      "required": ["title", "code"],
      "properties": {
        "title": {
          "type": "string",
          "description": "short title for the error"
        },
        "code": {
          "type": "string",
          "description": "error code"
        },
        "description": {
          "type": "string",
          "description": "long description of the error"
        },
        "component": {
          "type": "string",
          "description": "source component of error"
        },
        "severity": {
          "type": "integer",
          "description": "severity",
          "minimum": 0,
          "maximum": 4
        },
        "parameters": {
          "type": "object",
          "description": "parameters to the current error as key value pairs of any type"
        },
        "position": {
          "type": "object",
          "$ref": "shared/position.schema.json",
          "description": "position at which the error occurred"
        }
      }
    }
  }
}
