{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/mycode-json/latest.json",
  "title": "JSON schema for mycode.js files",
  "x-lintel": {
    "source": "https://www.schemastore.org/mycode.json",
    "sourceSha256": "a84180e3cad6cfa4d2994faf6c04004fbc345bae2834ea866c570a74b86da738",
    "fileMatch": [
      "mycode.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "Eval": {
      "description": "Script that is executed by passing a string to the host-provided eval function.",
      "default": "MyCode",
      "allOf": [
        {
          "$ref": "#/$defs/classification"
        }
      ]
    },
    "Function": {
      "description": "Script that is executed by passing a string to the 'Function' constructor.",
      "default": "LibraryCode",
      "allOf": [
        {
          "$ref": "#/$defs/classification"
        }
      ]
    },
    "ScriptBlock": {
      "description": "Script that is executed by passing a string to the 'setTimeout', 'setImmediate', or 'setInterval' functions.",
      "default": "UnrelatedCode",
      "allOf": [
        {
          "$ref": "#/$defs/classification"
        }
      ]
    },
    "MyCode": {
      "description": "An array of urls or files that are classified as 'MyCode'.",
      "allOf": [
        {
          "$ref": "#/$defs/includes"
        }
      ]
    },
    "Libraries": {
      "description": "An array of urls or files that are classified as 'LibraryCode'.",
      "allOf": [
        {
          "$ref": "#/$defs/includes"
        }
      ]
    },
    "Unrelated": {
      "description": "An array of urls or files that are classified as 'UnrelatedCode'.",
      "allOf": [
        {
          "$ref": "#/$defs/includes"
        }
      ]
    }
  },
  "id": "https://json.schemastore.org/mycode.json",
  "$defs": {
    "classification": {
      "enum": [
        "MyCode",
        "LibraryCode",
        "UnrelatedCode"
      ]
    },
    "includes": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    }
  }
}
