{
  "title": "JSON schema for menu.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": true,
  "propertyNames": {
    "enum": [
      "fileContextMenu"
    ]
  },
  "properties": {
    "fileContextMenu": {
      "description": "Indicates the name of the fileContextMenu.",
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": [
          "abilityName",
          "menuItem",
          "menuHandler",
          "menuContext"
        ],
        "propertyNames": {
          "enum": [
            "abilityName",
            "menuItem",
            "menuHandler",
            "menuContext"
          ]
        },
        "properties": {
          "abilityName": {
            "description": "Indicates the name of the ability.",
            "type": "string",
            "pattern": "^[a-zA-Z][0-9a-zA-Z_.]*$",
            "maxLength": 255
          },
          "menuItem": {
            "description": "Indicates the name of the menuItem.",
            "type": "string",
            "maxLength": 255,
            "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$"
          },
          "menuHandler": {
            "description": "Indicates the name of the menuHandler.",
            "type": "string",
            "pattern": "^[a-zA-Z][0-9a-zA-Z_.]*$",
            "maxLength": 255
          },
          "menuContext": {
            "description": "Indicates the name of the menuContext.",
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "object",
              "required": [
                "menuKind"
              ],
              "propertyNames": {
                "enum": [
                  "menuKind",
                  "menuRule",
                  "fileSupportType",
                  "fileNotSupportType"
                ]
              },
              "properties": {
                "menuKind": {
                  "description": "Indicates the name of the menuKind.",
                  "type": "integer",
                  "enum": [
                    0,
                    1,
                    2,
                    3
                  ]
                },
                "menuRule": {
                  "description": "Indicates the name of the menuRule.",
                  "type": "string",
                  "enum": [
                    "single",
                    "multi",
                    "both"
                  ]
                },
                "fileSupportType": {
                  "description": "Indicates the name of the fileSupportType.",
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "pattern": "^\\.[a-zA-Z]+|\\*$",
                    "maxLength": 20
                  }
                },
                "fileNotSupportType": {
                  "description": "Indicates the name of the fileNotSupportType.",
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "pattern": "^\\.[a-zA-Z]+$",
                    "maxLength": 20
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
