{
  "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": 10,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": [
          "menuItem"
        ],
        "propertyNames": {
          "enum": [
            "abilityName",
            "menuItem",
            "menuHandler",
            "menuContext",
            "menuSubItems"
          ]
        },
        "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
                  }
                },
                "ignoreActiveStatus": {
                  "description": "Indicates the name of the ignoreActiveStatus.",
                  "type": "boolean"
                },
                "fileSupportSyncStatus": {
                  "description": "Indicates the name of the fileSupportSyncStatus.",
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "enum": [
                      "IDLE",
                      "SYNCING",
                      "SYNC_SUCCESSED",
                      "SYNC_FAILED",
                      "SYNC_CANCELED",
                      "SYNC_CONFLICTED"
                    ]
                  }
                },
                "fileNotSupportSyncStatus": {
                  "description": "Indicates the name of the fileNotSupportSyncStatus.",
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "enum": [
                      "IDLE",
                      "SYNCING",
                      "SYNC_SUCCESSED",
                      "SYNC_FAILED",
                      "SYNC_CANCELED",
                      "SYNC_CONFLICTED"
                    ]
                  }
                }
              }
            }
          },
          "menuSubItems": {
            "description": "Indicates the name of the menuSubItems.",
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "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
                        }
                      },
                      "ignoreActiveStatus": {
                        "description": "Indicates the name of the ignoreActiveStatus.",
                        "type": "boolean"
                      },
                      "fileSupportSyncStatus": {
                        "description": "Indicates the name of the fileSupportSyncStatus.",
                        "type": "array",
                        "maxItems": 100,
                        "items": {
                          "type": "string",
                          "enum": [
                            "IDLE",
                            "SYNCING",
                            "SYNC_SUCCESSED",
                            "SYNC_FAILED",
                            "SYNC_CANCELED",
                            "SYNC_CONFLICTED"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}