{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/university-of-waterloo/json-schema/university-of-waterloo-class-schema.json",
  "title": "Class",
  "description": "Represents an Academic class, which is a scheduled instance of a Course",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/university-of-waterloo-classschedules-api-openapi.yml#/components/schemas/Class",
  "type": "object",
  "properties": {
    "courseId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Course identifier number, not unique"
    },
    "courseOfferNumber": {
      "type": "integer",
      "description": "Course offer number identifier for this class",
      "format": "int32"
    },
    "sessionCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Session code for this class"
    },
    "classSection": {
      "type": "integer",
      "description": "Number identifying the section of this class",
      "format": "int32"
    },
    "termCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Waterloo academic term code"
    },
    "classNumber": {
      "type": "integer",
      "description": "Class number identifier for this class",
      "format": "int32"
    },
    "courseComponent": {
      "type": [
        "string",
        "null"
      ],
      "description": "Course component code for this class"
    },
    "associatedClassCode": {
      "type": "integer",
      "description": "Associated class code for this class",
      "format": "int32"
    },
    "maxEnrollmentCapacity": {
      "type": "integer",
      "description": "Indicates the maximum number of students that can enroll in this class",
      "format": "int32"
    },
    "enrolledStudents": {
      "type": "integer",
      "description": "Indicates the current number of students enrolled in this class",
      "format": "int32"
    },
    "enrollConsentCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Code describing whether No, Instructor, or Department consent to enroll is required. Overrides Course level information if different."
    },
    "enrollConsentDescription": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the enroll requirement. Overrides Course level information if different.",
      "readOnly": true
    },
    "dropConsentCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Code describing whether No, Instructor, or Department consent to drop is required. Overrides Course level information if different."
    },
    "dropConsentDescription": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the drop requirement. Overrides Course level information if different.",
      "readOnly": true
    },
    "scheduleData": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClassSchedule"
      },
      "description": "Schedule data for this class"
    },
    "instructorData": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClassInstructor"
      },
      "description": "Instructor data for this class"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ClassInstructor": {
      "type": "object",
      "properties": {
        "courseId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Course identifier number, not unique"
        },
        "courseOfferNumber": {
          "type": "integer",
          "description": "Course offer number identifier for this class",
          "format": "int32"
        },
        "sessionCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Session code number for this class"
        },
        "classSection": {
          "type": "integer",
          "description": "Number identifying the section of this class",
          "format": "int32"
        },
        "termCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Waterloo academic term code"
        },
        "instructorRoleCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "REMOVED for privacy. The code designation for the instructor's role in this class"
        },
        "instructorFirstName": {
          "type": [
            "string",
            "null"
          ],
          "description": "REMOVED for privacy. The Instructors preferred first name"
        },
        "instructorLastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "REMOVED for privacy. The Instructors preferred last name"
        },
        "instructorUniqueIdentifier": {
          "type": [
            "string",
            "null"
          ],
          "description": "REMOVED for privacy. A unique identifier that persists through name changes. Not guaranteed, but likely to be immutable for instructor."
        },
        "classMeetingNumber": {
          "type": "integer",
          "description": "Identifier for the class meeting this instructor is for",
          "format": "int32"
        }
      },
      "additionalProperties": false,
      "description": "A person instructing a Class"
    },
    "ClassSchedule": {
      "type": "object",
      "properties": {
        "courseId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Course identifier number, not unique"
        },
        "courseOfferNumber": {
          "type": "integer",
          "description": "Course offer number identifier for this class",
          "format": "int32"
        },
        "sessionCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Session code number for this class"
        },
        "classSection": {
          "type": "integer",
          "description": "Number identifying the section of this class",
          "format": "int32"
        },
        "termCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Waterloo academic term code"
        },
        "classMeetingNumber": {
          "type": "integer",
          "description": "Identifier for the class meeting this schedule data relates to",
          "format": "int32"
        },
        "scheduleStartDate": {
          "type": "string",
          "description": "The date this schedule begins",
          "format": "date-time"
        },
        "scheduleEndDate": {
          "type": "string",
          "description": "The date this schedule ends",
          "format": "date-time"
        },
        "classMeetingStartTime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The start time of this class",
          "format": "date-time"
        },
        "classMeetingEndTime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The end time of this class",
          "format": "date-time"
        },
        "classMeetingDayPatternCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "A code representing the days the class schedule takes place during the week"
        },
        "classMeetingWeekPatternCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "A Y|N per day representation of the class schedule taking place during the week"
        },
        "locationName": {
          "type": [
            "string",
            "null"
          ],
          "description": "REMOVED for privacy. Building and room name for the location of this class schedule"
        }
      },
      "additionalProperties": false,
      "description": "Data describing scheduling and availability data for a Class"
    }
  }
}