{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trolie/json-schema/trolie-request-schema.json",
  "title": "request",
  "description": "\nRequest body for creating a monitoring set. The server will assign an id and\nsource upon successful creation.\n\nNote that any `alternate-identifiers` supplied in the request should be\nshould be used by the server to define an alternate identifier for the\nassociated with a power system resource. In this way monitoring sets can be\nused to introduce use case specific names for existing power system\nresources. The details of how alternate identifiers are managed and resolved\nare are out of scope for this specification. In particular how the\n`authority` of an alternate identifier is validated is\nimplementation-specific and out of scope for this specification..\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trolie-monitoring-sets-api-openapi.yml#/components/schemas/request",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "A human-readable name for this monitoring set",
      "maxLength": 255,
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9 _-]{1,255}$"
    },
    "description": {
      "type": "string",
      "format": "free-form",
      "description": "A description of this monitoring set",
      "maxLength": 1000
    },
    "power-system-resources": {
      "$ref": "#/$defs/named-power-system-resources"
    }
  },
  "required": [
    "power-system-resources",
    "name"
  ],
  "$defs": {
    "entity": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^(.){0,500}$",
      "description": "Contains a unique identifier for an entity, such as a grid operator or\norganization. This identifier is typically used in the context of data\nexchange between entities.\n"
    },
    "local": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^(.){0,500}$",
      "description": "Contains a identifier that is unique for an object in the context of an\nexchange between two grid operators.\n"
    },
    "name-type": {
      "description": "Type of the name being referenced.  Corresponds to the IEC CIM `NameType` concept.",
      "type": "string",
      "maxLength": 20,
      "pattern": "^[A-Za-z0-9\\-]{3,20}$"
    },
    "named-power-system-resources": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50000,
      "description": "Collection of power system resource names",
      "items": {
        "$ref": "#/$defs/names"
      }
    },
    "names": {
      "type": "object",
      "properties": {
        "resource-id": {
          "$ref": "#/$defs/resource-id"
        },
        "alternate-identifiers": {
          "type": "array",
          "maxItems": 10,
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "$ref": "#/$defs/local"
              },
              "type": {
                "$ref": "#/$defs/name-type"
              },
              "authority": {
                "$ref": "#/$defs/entity"
              },
              "mrid": {
                "$ref": "#/$defs/local"
              }
            },
            "required": [
              "name"
            ]
          }
        }
      },
      "required": [
        "resource-id"
      ]
    },
    "resource-id": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^(.){0,500}$",
      "description": "Contains a unique identifier for a power system resource, such as a\ntransmission facility, segment, interface, etc. This identifier is typically\nused between reliability coordinators in operations.\n"
    }
  }
}