{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/eduapi/v1p0/schema/json/eduapi_v1p0_componenttemplate-jsonschema1.json",
  "title" : "JSON Schema for the ComponentTemplate class.",
  "description" : "A subsection of a Course or Class. It may be a lesson unit within a Class or it may be a separately enrolled unit with a Course. For example, Biology 101 may consist of a Lecture component and a Lab component.",
  "type" : "object",
  "properties" : {
    "componentType" : {
      "description" : "A representation of what the entity defines. It is based on an extensible enumerated vocabulary.",
      "$comment" : "Origin: ComponentTypeEnum (EnumExt); The set of permitted values for `componentType`.",
      "oneOf" : [ {
        "type" : "string",
        "enum" : [ "individualizedInstruction", "integratedLectureLab", "laboratory", "lecture", "practicum", "recitation", "research", "seminar", "independentStudy", "fieldExperience", "exam" ]
      }, {
        "type" : "string",
        "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
      } ]
    },
    "parent" : {
      "type" : "array",
      "items" : {
        "description" : "A reference to the parent Course.",
        "$comment" : "Origin: CourseTemplateGUIDRef (DerivedType); A reference to a `Course` object that has an allocated sourcedId (`GUID`).",
        "type" : "string"
      }
    },
    "sourcedId" : {
      "description" : "The sourcedId of the object. This is the interoperability identifier that systems will refer to when making API calls, or when needing to identify an object. Systems SHOULD be able to map whichever local ids (e.g. database key fields) they use to sourcedId. The sourcedId of an object MUST be an anonymized or pseudonymized identifier of an entity and as such will not contain Personally Identifiable Information (PII) or Personal Data (PD).",
      "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
      "type" : "string"
    },
    "recordLanguage" : {
      "description" : "The primary language used in the described entity.",
      "$comment" : "Origin: LanguageCode (DerivedType); A language code [[BCP47]].",
      "type" : "string",
      "pattern" : "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
    },
    "title" : {
      "type" : "array",
      "minItems" : 1,
      "items" : {
        "$ref" : "#/$defs/LanguageTypedString"
      }
    },
    "description" : {
      "type" : "array",
      "minItems" : 1,
      "items" : {
        "$ref" : "#/$defs/LanguageTypedString"
      }
    },
    "primaryCode" : {
      "$ref" : "#/$defs/IdentifierEntry"
    },
    "otherCodes" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/$defs/IdentifierEntry"
      }
    },
    "subjectCodes" : {
      "type" : "array",
      "items" : {
        "description" : "The set of subjects, represented by codes that this education addresses",
        "$comment" : "Origin: String (PrimitiveType); Character strings.",
        "type" : "string"
      }
    },
    "organization" : {
      "description" : "A reference to an Edu-API Organization.",
      "$comment" : "Origin: OrganizationGUIDRef (DerivedType); A reference to an `Organization` object that has an allocated sourcedId (`GUID`).",
      "type" : "string"
    },
    "organizationCode" : {
      "description" : "A business code used to system might use to reference an organization",
      "$comment" : "Origin: String (PrimitiveType); Character strings.",
      "type" : "string"
    },
    "level" : {
      "description" : "The educational level that the entity is for. This is represented by an extensible enumerated vocabulary and commonly varies by institution and region.",
      "$comment" : "Origin: EducationLevelEnum (EnumExt); The set of permitted values for `edcucationLevel`.",
      "oneOf" : [ {
        "type" : "string",
        "enum" : [ "graduate", "undergraduate", "doctoral" ]
      }, {
        "type" : "string",
        "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
      } ]
    },
    "creditType" : {
      "description" : "Reference to what the completion of this entity counts towards. This is represented by an extensible enumerated vocabulary.",
      "$comment" : "Origin: CreditTypeEnum (EnumExt); The set of permitted values for `creditType`.",
      "oneOf" : [ {
        "type" : "string",
        "enum" : [ "credit", "nonCredit" ]
      }, {
        "type" : "string",
        "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
      } ]
    },
    "creditsAwarded" : {
      "description" : "A description of the credits that the student receives after the completion of the education.",
      "$comment" : "Origin: String (PrimitiveType); Character strings.",
      "type" : "string"
    },
    "gradingScheme" : {
      "type" : "array",
      "minItems" : 1,
      "items" : {
        "$ref" : "#/$defs/LanguageTypedString"
      }
    },
    "teachingLanguage" : {
      "description" : "The main language used to relay the content of the offering.",
      "$comment" : "Origin: LanguageCode (DerivedType); A language code [[BCP47]].",
      "type" : "string",
      "pattern" : "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
    },
    "recordStatus" : {
      "description" : "The status of this record. A record 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 required to do so.",
      "$comment" : "Origin: RecordStatusTypeEnum (Enum); The set of values to describe the state of a record in the source system. For systems migrating from, or making use of OneRoster, deleted is to be considered synonymous with toBeDeleted.",
      "type" : "string",
      "enum" : [ "active", "deleted", "inactive" ]
    },
    "dateLastModified" : {
      "description" : "A timestamp describing when this record was last modified.",
      "$comment" : "Origin: DateTimeZ (DerivedType); A `DateTime` with the trailing timezone specifier included, e.g. `2021-09-07T02:09:59+02:00`",
      "type" : "string",
      "format" : "date-time"
    },
    "extensions" : {
      "$ref" : "#/$defs/educationExtensions"
    }
  },
  "required" : [ "componentType", "sourcedId", "recordLanguage", "title", "description", "primaryCode", "organization", "level", "creditType", "gradingScheme", "recordStatus" ],
  "additionalProperties" : false,
  "$defs" : {
    "IdentifierEntry" : {
      "description" : "A container to transmit additional needed identifiers",
      "type" : "object",
      "properties" : {
        "identifier" : {
          "description" : "An identifier.",
          "$comment" : "Origin: Identifier (DerivedType); A `NormalizedString` that functions as an identifier.",
          "type" : "string"
        },
        "identifierType" : {
          "description" : "The identifier type.",
          "$comment" : "Origin: IdentifierTypeEnum (EnumExt)",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "systemId", "productId", "userName", "accountId", "emailAddress", "nationalIdentityNumber", "isbn", "issn", "lisSourcedId", "oneRosterSourcedId", "sisSourcedId", "ltiContextId", "ltiDeploymentId", "ltiToolId", "ltiPlatformId", "ltiUserId", "identifier" ]
          }, {
            "type" : "string",
            "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
          } ]
        }
      },
      "required" : [ "identifier", "identifierType" ],
      "additionalProperties" : false
    },
    "LanguageTypedString" : {
      "description" : "A String with an associated language code.",
      "type" : "object",
      "properties" : {
        "recordLanguage" : {
          "description" : "The primary language used in the described entity.",
          "$comment" : "Origin: LanguageCode (DerivedType); A language code [[BCP47]].",
          "type" : "string",
          "pattern" : "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
        },
        "value" : {
          "description" : "No description supplied.",
          "$comment" : "Origin: String (PrimitiveType); Character strings.",
          "type" : "string"
        }
      },
      "required" : [ "recordLanguage", "value" ],
      "additionalProperties" : false
    },
    "educationExtensions" : {
      "description" : "Extension properties related to education templates",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    }
  }
}