{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/orgradebook/v1p2/schema/json/orgradebook_v1p2_singlelineitem-jsonschema1.json",
  "title" : "JSON Schema for the SingleLineItem class.",
  "description" : "This is the container for a single lineItem instance for a message payload.",
  "type" : "object",
  "properties" : {
    "lineItem" : {
      "$ref" : "#/$defs/LineItem"
    }
  },
  "required" : [ "lineItem" ],
  "additionalProperties" : false,
  "$defs" : {
    "LineItem" : {
      "description" : "This is the container for the definition of a lineItem. A lineItem is a collection of results for a set of students who are completing an assignment as part of a class at a school.",
      "type" : "object",
      "properties" : {
        "title" : {
          "description" : "The title, human readable, for the lineItem.  This should allow the lineItem to be distinguished from its peer lineItems.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "type" : "string"
        },
        "description" : {
          "description" : "A human readable description of the usage of the lineItem.",
          "$comment" : "Origin: String (PrimitiveType)",
          "type" : "string"
        },
        "assignDate" : {
          "description" : "The date/time the activity being addressed by the lineItem was assigned to the student. This has a format as defined in [ISO 8601].",
          "$comment" : "Origin: DateTime (PrimitiveType)",
          "type" : "string",
          "format" : "date-time"
        },
        "dueDate" : {
          "description" : "The date/time by which the assignment must be completed and submitted. This has the dateTime format as defined in [ISO 8601].",
          "$comment" : "Origin: DateTime (PrimitiveType)",
          "type" : "string",
          "format" : "date-time"
        },
        "class" : {
          "$ref" : "#/$defs/ClassGUIDRef"
        },
        "school" : {
          "$ref" : "#/$defs/OrgGUIDRef"
        },
        "category" : {
          "$ref" : "#/$defs/CategoryGUIDRef"
        },
        "gradingPeriod" : {
          "$ref" : "#/$defs/AcadSessionGUIDRef"
        },
        "academicSession" : {
          "$ref" : "#/$defs/AcadSessionGUIDRef"
        },
        "scoreScale" : {
          "$ref" : "#/$defs/ScoreScaleGUIDRef"
        },
        "resultValueMin" : {
          "description" : "The minimum value (numeric) that can be assigned to the score attribute in a result. The score scale mapping should be used to map to other scores.",
          "$comment" : "Origin: Float (PrimitiveType)",
          "type" : "number"
        },
        "resultValueMax" : {
          "description" : "The maximum value (numeric) that can be assigned to the score attribute in a result. The score scale mapping should be used to map to other scores.",
          "$comment" : "Origin: Float (PrimitiveType)",
          "type" : "number"
        },
        "learningObjectiveSet" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/LearningObjectiveSet"
          }
        },
        "sourcedId" : {
          "description" : "The sourcedId of the object. All objects MUST be identified by a Source Identifier. This is a GUID System ID for an object. This is the GUID 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, but particularly users. This means that if a customer includes a student name in an enrollment.sourcedId, it will not fall to any certified product to protect the enrollment.sourcedId as PII, or even the userSourcedId field in the enrollment record.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "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"
        },
        "metadata" : {
          "$ref" : "#/$defs/Metadata"
        }
      },
      "required" : [ "title", "assignDate", "dueDate", "class", "school", "category", "sourcedId", "status", "dateLastModified" ],
      "additionalProperties" : false
    },
    "ScoreScaleGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'ScoreScale' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'scoreScale'.",
          "$comment" : "Origin: ScoreScaleGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'ScoreScale'. ",
          "type" : "string",
          "enum" : [ "scoreScale" ]
        },
        "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: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "ClassGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Class' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'class'.",
          "$comment" : "Origin: ClassGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'Class'. ",
          "type" : "string",
          "enum" : [ "class" ]
        },
        "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: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "CategoryGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Category' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'category'.",
          "$comment" : "Origin: CategoryGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'Category'. ",
          "type" : "string",
          "enum" : [ "category" ]
        },
        "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: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "LearningObjectiveSet" : {
      "description" : "This is the container for the set of learning objective identifiers that are from a single source responsible for creating those identifiers.",
      "type" : "object",
      "properties" : {
        "source" : {
          "description" : "The source responsible for creating the learning objective identifiers. The permitted values are from an extensible vocabulary.",
          "$comment" : "Origin: SourceExtEnum (Union); This is an extensible vocabulary data-type for the source creating the learning objective identifiers.",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "case", "unknown" ]
          }, {
            "type" : "string",
            "pattern" : "^(?!case$)(?!unknown$)[a-zA-Z0-9\\.\\-_]+$"
          } ]
        },
        "learningObjectiveIds" : {
          "type" : "array",
          "minItems" : 1,
          "items" : {
            "description" : "The set of unique identifiers for the associated learning objectives. If these are CASE identifiers they MUST be valid UUIDs.",
            "$comment" : "Origin: NormalizedString (PrimitiveType)",
            "type" : "string"
          }
        }
      },
      "required" : [ "source", "learningObjectiveIds" ],
      "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: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "Metadata" : {
      "description" : "The container for the proprietary extensions.",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    },
    "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: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    }
  }
}