{
  "$id": "blueprintitem-metadata.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "allOf": [
    {
      "if": { "properties": { "key": { "const": "src:LessonCode" } } },
      "then": {
        "properties": {
          "value": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "src:Platform" } } },
      "then": {
        "properties": {
          "value": {
            "type": "string",
            "enum": [ "AIA", "Creatium", "LearningMate" ]
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "tax:Subject" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "Math",
                "Language Arts",
                "Science",
                "Social and Emotional Learning",
                "Social Studies",
                "World Languages",
                "General Electives",
                "CTE Electives",
                "Spanish Language Arts",
                "English Language Development"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "src:ActivityID" } } },
      "then": {
        "properties": {
          "value": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "src:MultIdentifier" } } },
      "then": {
        "properties": {
          "value": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:GradeLevel" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "PK",
                "K",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "HS"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:Product" } } },
      "then": {
        "properties": {
          "value": {
            "type": "string",
            "enum": [
              "MPNG",
              "EdgeEX",
              "Project Link",
              "ImaginePlus Math",
              "Imagine Language and Literacy"
            ]
          }
        }
      }
    }
  ],
  "properties": {
    "key": {
      "type": "string",
      "enum": [
        "src:LessonCode",
        "src:Platform",
        "tax:Subject",
        "src:ActivityID",
        "src:MultIdentifier",
        "meta:GradeLevel",
        "meta:Product"
      ]
    },
    "value": {}
  },
  "required": ["key", "value"],
  "title": "Blueprint Item Metadata",
  "type": "object"
}
