{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/orrostering/v1p2/schema/json/orrostering_v1p2_singleacademicsession-jsonschema1.json",
  "title" : "JSON Schema for the SingleAcademicSession class.",
  "description" : "This is the container for a single academicSession instance for a message payload.",
  "type" : "object",
  "properties" : {
    "academicSession" : {
      "$ref" : "#/$defs/AcademicSession"
    }
  },
  "required" : [ "academicSession" ],
  "additionalProperties" : false,
  "$defs" : {
    "AcademicSession" : {
      "description" : "The container for an academicSession. An academicSession represents a duration of time. Typically they are used to describe terms, grading periods, and other durations e.g. school years. Term is used to describe a period of time during which learning will take place. Other words for term could be in common use around the world e.g. Semester. The important thing is that Term is a unit of time, often many weeks long, into which classes are scheduled. Grading Period is used to represent another unit of time, that within which line items are assessed. A term may have many grading periods, a grading period belongs to a single term. A class may be assessed over several grade periods (represented by a line item being connected to a grading period). The parent / child attributes of academic sessions allow terms to be connected to their grading periods and vice-versa. ",
      "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 W3C profile of [ISO 8601] and MUST contain the UTC timezone.",
          "$comment" : "Origin: DateTime (PrimitiveType)",
          "type" : "string",
          "format" : "date-time"
        },
        "title" : {
          "description" : "The title/label for the academic session.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "type" : "string"
        },
        "startDate" : {
          "description" : "The start date for the academic session. The start date is included in the academic session. This is in [ISO 8601] format of 'YYYY-MM-DD'.",
          "$comment" : "Origin: Date (PrimitiveType)",
          "type" : "string",
          "format" : "date"
        },
        "endDate" : {
          "description" : "The end date for the academic session. The end date is excluded from the academic session. This is in [ISO 8601] format of 'YYYY-MM-DD'.",
          "$comment" : "Origin: Date (PrimitiveType)",
          "type" : "string",
          "format" : "date"
        },
        "type" : {
          "description" : "The type of academic session. This is based upon an enumerated vocabulary.",
          "$comment" : "Origin: SessionTypeEnumExt (Union); The data-type for the type of academic session. This is an extensible enumerated vocabulary. Extending the vocabulary makes use of a naming convention.",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "gradingPeriod", "semester", "schoolYear", "term" ]
          }, {
            "type" : "string",
            "pattern" : "(ext:)[a-zA-Z0-9\\.\\-_]+"
          } ]
        },
        "parent" : {
          "$ref" : "#/$defs/AcadSessionGUIDRef"
        },
        "children" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/AcadSessionGUIDRef"
          }
        },
        "schoolYear" : {
          "description" : "The school year for the academic session.  This year should include the school year end e.g. 2014. This is in the [ISO 8601] format of 'YYYY'.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "type" : "string"
        },
        "metadata" : {
          "$ref" : "#/$defs/MetadataGeneral"
        }
      },
      "required" : [ "sourcedId", "status", "dateLastModified", "title", "startDate", "endDate", "type", "schoolYear" ],
      "additionalProperties" : false
    },
    "MetadataGeneral" : {
      "description" : "The container for the proprietary extensions.",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    },
    "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
    }
  }
}