{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/orrostering/v1p2/schema/json/orrostering_v1p2_singlecourse-jsonschema1.json",
  "title" : "JSON Schema for the SingleCourse class.",
  "description" : "This is the container for a single course instance for a message payload.",
  "type" : "object",
  "properties" : {
    "course" : {
      "$ref" : "#/$defs/Course"
    }
  },
  "required" : [ "course" ],
  "additionalProperties" : false,
  "$defs" : {
    "Course" : {
      "description" : "The information about a course. A Course is a course of study that, typically, has a shared curriculum although it may be taught to different students by different teachers. It is likely that several classes of a single course may be taught in a term. For example, a school runs Grade 9 English in the spring term. There are four classes, each with a different 30 students, taught by 4 different teachers. However the curriculum for each of those four classes is the same i.e. the course curriculum.",
      "type" : "object",
      "properties" : {
        "sourcedId" : {
          "description" : "The sourcedId of the object. All objects MUST be identified by a Source Identifier. This is an interoperability System ID for an object. This is the identifier that SYSTEMS will refer to when making API calls, or when needing to identify an object. It is RECOMMENDED that systems are able to map whichever local ids (e.g. database key fields) they use to SourcedId. The sourcedId of an object is considered an addressable property of an entity and as such will not be treated as Personally Identifiable Information (PII) by certified products. Therefore, as a part of certification, vendors will be required to declare that they will notify customers via documentation or other formal and documented agreement that sourcedIds should never contain PII in general.",
          "$comment" : "Origin: SourcedId (DerivedType); The data-type for establishing a Unique Identifier. There is no predefined structure for the identifier and the scope MUST NOT assume globally uniqueness.",
          "type" : "string"
        },
        "status" : {
          "description" : "All objects MUST BE either 'active' or 'tobedeleted'. Something which is flagged 'tobedeleted' is to be considered safe to delete. Systems can delete records that are flagged as such if they wish, but they are not under any compulsion to do so. In v1.1 the enumeration value of 'inactive' was removed and so for backwards compatibility all such marked objects should be interpreted as 'tobedeleted'.",
          "$comment" : "Origin: BaseStatusEnum (Enumeration); The set of permitted values for the type of status of a record. ",
          "type" : "string",
          "enum" : [ "active", "tobedeleted" ]
        },
        "dateLastModified" : {
          "description" : "All objects MUST be annotated with the dateTime upon which they were last modified. This enables requesters to query for just the latest objects. DateTimes MUST be expressed in the format 'YYYY-MM-DDThh:mm:ss.sssZ' [ISO 8601].",
          "$comment" : "Origin: DateTime (PrimitiveType)",
          "type" : "string",
          "format" : "date-time"
        },
        "title" : {
          "description" : "The title of the course.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "type" : "string"
        },
        "schoolYear" : {
          "$ref" : "#/$defs/AcadSessionGUIDRef"
        },
        "courseCode" : {
          "description" : "The assigned course code.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "type" : "string"
        },
        "grades" : {
          "type" : "array",
          "items" : {
            "description" : "Grade(s) for which the class is attended. The permitted vocabulary should be defined as part of the adoption and deployment process. See the Implementation Guide [OR-IMPL-12] for more details on how to define/use such a vocabulary.",
            "$comment" : "Origin: NormalizedString (PrimitiveType)",
            "type" : "string"
          }
        },
        "subjects" : {
          "type" : "array",
          "items" : {
            "description" : "The set of subjects addressed by this course. This is a set of human readable strings.  ",
            "$comment" : "Origin: NormalizedString (PrimitiveType)",
            "type" : "string"
          }
        },
        "org" : {
          "$ref" : "#/$defs/OrgGUIDRef"
        },
        "subjectCodes" : {
          "type" : "array",
          "items" : {
            "description" : "This is a machine readable set of codes and the number should match the associated 'subjects' attribute. The vocabulary for this characteristic should be defined as part of the local addition of this specification (see the Implementation Guide [OR-IMPL-12] for more details).",
            "$comment" : "Origin: NormalizedString (PrimitiveType)",
            "type" : "string"
          }
        },
        "resources" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/ResourceGUIDRef"
          }
        },
        "metadata" : {
          "$ref" : "#/$defs/MetadataCourse"
        }
      },
      "required" : [ "sourcedId", "status", "dateLastModified", "title", "org" ],
      "additionalProperties" : false
    },
    "OrgGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Org' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. an 'org'.",
          "$comment" : "Origin: OrgGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'Org'.",
          "type" : "string",
          "enum" : [ "org" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: SourcedId (DerivedType); The data-type for establishing a Unique Identifier. There is no predefined structure for the identifier and the scope MUST NOT assume globally uniqueness.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "MetadataCourse" : {
      "description" : "The container for the proprietary extensions in the Course class.",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    },
    "ResourceGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Resource' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'resource'.",
          "$comment" : "Origin: ResourceGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to a 'Resource'.",
          "type" : "string",
          "enum" : [ "resource" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: SourcedId (DerivedType); The data-type for establishing a Unique Identifier. There is no predefined structure for the identifier and the scope MUST NOT assume globally uniqueness.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "AcadSessionGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Academic Session' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. an 'academicSession'.",
          "$comment" : "Origin: AcadSessionGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'Academic Session'.",
          "type" : "string",
          "enum" : [ "academicSession" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: SourcedId (DerivedType); The data-type for establishing a Unique Identifier. There is no predefined structure for the identifier and the scope MUST NOT assume globally uniqueness.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    }
  }
}