{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "EducationDegree",
  "$id": "education-degree",
  "type": "object",
  "definitions": {
    "DID": {
      "type": "string",
      "pattern": "^did:[a-z0-9]+:[A-Za-z0-9._:?=&%;-]+$"
    },
    "MultiLingualString": {
      "type": "object",
      "properties": {
        "localized": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[a-z]{2}(_[A-Z]{2})?$"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "preferredLocale": {
          "type": "object",
          "properties": {
            "country": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "language": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "localized"
      ]
    },
    "Date": {
      "type": "object",
      "properties": {
        "day": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31
        },
        "month": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "year": {
          "type": "integer",
          "minimum": 1950
        }
      },
      "additionalProperties": false
    },
    "Location": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "An uppercase two-letter country code as defined by [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)"
        },
        "regionCode": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,3}$",
          "description": "An uppercase region code as defined by [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)"
        }
      }
    },
    "Alignment": {
      "type": "object",
      "properties": {
        "targetName": {
          "type": "string",
          "description": "CCSS.ELA-Literacy.RST.11-12.3"
        },
        "targetUrl": {
          "type": "string",
          "format": "uri",
          "description": "http://www.corestandards.org/ELA-Literacy/RST/11-12/3"
        },
        "targetDescription": {
          "type": "string",
          "description": "A description of the ELA ltieracy certification."
        },
        "targetCode": {
          "type": "string",
          "description": "CCSS.ELA-Literacy.RST.11-12.3"
        },
        "targetFramework": {
          "type": "string",
          "description": "Mozilla 21st Century Skills"
        }
      },
      "required": [
        "targetName",
        "targetUrl"
      ],
      "additionalProperties": false
    }
  },
  "properties": {
    "school": {
      "$ref": "#/definitions/DID",
      "description": "Standardized referenced Organization DID."
    },
    "schoolName": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "School name."
    },
    "degreeName": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "Degree attained at this school."
    },
    "program": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "School program string"
    },
    "grade": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "Grade attained in the area of study."
    },
    "notes": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "Description for additional details about this education."
    },
    "fieldsOfStudy": {
      "$ref": "#/definitions/MultiLingualString",
      "description": "Degrees achieved in respective fields of study."
    },
    "startMonthYear": {
      "$ref": "#/definitions/Date",
      "description": "Start date of the education. It is a Date. Does not support the 'month' field."
    },
    "endMonthYear": {
      "$ref": "#/definitions/Date",
      "description": "End date of the education. Does not support 'day' field. Missing value means the position is current."
    },
    "alignment": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Alignment"
      }
    }
  },
  "required": [
    "school",
    "schoolName",
    "degreeName",
    "program",
    "startMonthYear",
    "endMonthYear"
  ]
}