{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/Schedule/v1/schema.json",
  "title": "Schedule",
  "description": "Objects Grid Schedule. When something repeats: a weekly class, a monthly meeting, with the dates it skips. Stored inside an Event's eventSchedule, a CourseInstance's courseSchedule or an EmployeeRole's workSchedule. Modeled in compliance with https://schema.org/Schedule.",
  "type": "object",
  "properties": {
    "at_type": {
      "description": "The object type",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "Schedule"
      ]
    },
    "byDay": {
      "description": "The days of the week it happens on",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/DayOfWeek/v1/schema.json"
      }
    },
    "byMonth": {
      "description": "The months it happens in, 1 for January",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 12
      }
    },
    "byMonthDay": {
      "description": "The days of the month it happens on, 1 to 31",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 31
      }
    },
    "byMonthWeek": {
      "description": "The weeks of the month it happens in, 1 for the first, -1 for the last",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "minimum": -5,
        "maximum": 5
      }
    },
    "repeatFrequency": {
      "description": "How often it repeats, an ISO 8601 duration, e.g. P1W for weekly",
      "type": [
        "string",
        "null"
      ],
      "minLength": 3,
      "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$"
    },
    "repeatCount": {
      "description": "How many times it happens in all",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "startDate": {
      "description": "The first date it happens",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "endDate": {
      "description": "The last date it may happen",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "startTime": {
      "description": "The time each occurrence starts, e.g. 18:30:00",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
    },
    "endTime": {
      "description": "The time each occurrence ends, e.g. 19:30:00",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
    },
    "duration": {
      "description": "How long each occurrence lasts, an ISO 8601 duration",
      "type": [
        "string",
        "null"
      ],
      "minLength": 3,
      "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$"
    },
    "exceptDate": {
      "description": "Dates it doesn't happen on, such as holidays",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "format": "date"
      }
    },
    "scheduleTimezone": {
      "description": "The IANA time zone of startTime and endTime, e.g. Europe/Berlin",
      "type": [
        "string",
        "null"
      ],
      "maxLength": 64
    }
  },
  "unevaluatedProperties": false
}
