{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-serial-template-schema.json",
  "title": "SerialTemplate",
  "description": "A saved set of RS232 commands for one panel model.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-serial-templates-api-openapi.yml#/components/schemas/SerialTemplate",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Serial template id."
    },
    "spaceId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Free-text panel model (`Sony Bravia FW-series`)."
    },
    "nodeId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Home location; null = workspace root."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "updatedAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Command id. Kept across edits, so saved buttons that name it keep working."
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "description": "The command: literal text (`ascii`) or hex digits (`hex`)."
          },
          "encoding": {
            "type": "string",
            "enum": [
              "ascii",
              "hex"
            ]
          },
          "eol": {
            "type": "string",
            "enum": [
              "none",
              "cr",
              "lf",
              "crlf"
            ],
            "description": "Line ending added after the value."
          },
          "hexPreview": {
            "type": "string",
            "description": "The exact bytes sent, as spaced hex (`2A 53 0A`)."
          }
        },
        "required": [
          "id",
          "name",
          "value",
          "encoding",
          "eol",
          "hexPreview"
        ]
      }
    }
  },
  "required": [
    "id",
    "spaceId",
    "name",
    "model",
    "nodeId",
    "createdAt",
    "updatedAt",
    "items"
  ]
}