{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$ref": "#/components/schemas/PkgSearchFormVM",
  "components": {
    "schemas": {
      "PkgSearchFormVM": {
        "required": [
          "iconKey",
          "key",
          "searchIndexKey",
          "template"
        ],
        "type": "object",
        "properties": {
          "iconKey": {
            "minLength": 1,
            "type": "string"
          },
          "key": {
            "minLength": 1,
            "type": "string"
          },
          "orderNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "searchIndexKey": {
            "minLength": 1,
            "type": "string"
          },
          "searchQueryKeys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "settings": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "required": [
                    "key"
                  ],
                  "type": "object",
                  "properties": {
                    "key": {
                      "minLength": 1,
                      "enum": [
                        "is_all_object_search_form",
                        "is_default_object_search_form",
                        "is_model_changes_search_form",
                        "is_file_script_search_form",
                        "is_codelist_search_form",
                        "is_add_relation_search_form",
                        "is_sample_data_form",
                        "is_tokenizer_definition_form",
                        "is_fulltext_search",
                        "replace_synonyms"
                      ],
                      "type": "string",
                      "readOnly": true
                    },
                    "value": {
                      "type": "boolean",
                      "nullable": true
                    }
                  }
                }
              ]
            },
            "nullable": true
          },
          "state": {
            "enum": [
              "active",
              "inactive",
              "in-validation",
              "hidden"
            ],
            "type": "string",
            "nullable": true
          },
          "template": {
            "$ref": "#/components/schemas/PkgFacetedSearchDefinitionVM"
          }
        },
        "additionalProperties": false
      },
      "PkgFacetedSearchDefinitionVM": {
        "type": "object",
        "properties": {
          "defaultFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PkgSearchTemplateFacetedVM"
            },
            "nullable": true
          },
          "formId": {
            "type": "string",
            "nullable": true
          },
          "resultTextLinesAfter": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "resultTextLinesBefore": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacetedSearchSortVM"
            },
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacetedSearchSortVM": {
        "required": [
          "reverse"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "reverse": {
            "type": "boolean"
          },
          "title": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PkgSearchTemplateFacetedVM": {
        "required": [
          "enumKey",
          "enumKeyType"
        ],
        "type": "object",
        "properties": {
          "boostFieldName": {
            "type": "string",
            "nullable": true
          },
          "boostValue": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "bucketCountLimit": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "defaultCollapsed": {
            "type": "boolean",
            "nullable": true
          },
          "elementType": {
            "enum": [
              "valueList",
              "hidden"
            ],
            "type": "string",
            "nullable": true
          },
          "enumKey": {
            "minLength": 1,
            "type": "string"
          },
          "enumKeyType": {
            "minLength": 1,
            "enum": [
              "application",
              "objectType",
              "space",
              "attribute",
              "relation",
              "userRelation",
              "codelist",
              "modelChanges",
              "script",
              "mr_data",
              "workflowState",
              "creator",
              "addRelation",
              "domainTypes",
              "userAttribute"
            ],
            "type": "string"
          },
          "iconId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "iconKey": {
            "type": "string",
            "nullable": true
          },
          "orderBucketsReverse": {
            "type": "boolean",
            "nullable": true
          },
          "orderBucketsType": {
            "type": "string",
            "nullable": true
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PkgSearchTemplateFacetedParameterVM"
            },
            "nullable": true
          },
          "primaryResultText": {
            "type": "boolean",
            "nullable": true
          },
          "showSelectAllValuesCheckBox": {
            "type": "boolean",
            "nullable": true
          },
          "subFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PkgSearchTemplateFacetedBaseVM"
            },
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "valueType": {
            "enum": [
              "none",
              "isText",
              "isTranslationKey",
              "isBoolean",
              "isNumber",
              "isDate",
              "isDateTime"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PkgSearchTemplateFacetedBaseVM": {
        "required": [
          "enumKey",
          "enumKeyType"
        ],
        "type": "object",
        "properties": {
          "boostFieldName": {
            "type": "string",
            "nullable": true
          },
          "boostValue": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "bucketCountLimit": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "defaultCollapsed": {
            "type": "boolean",
            "nullable": true
          },
          "elementType": {
            "enum": [
              "valueList",
              "hidden"
            ],
            "type": "string",
            "nullable": true
          },
          "enumKey": {
            "minLength": 1,
            "type": "string"
          },
          "enumKeyType": {
            "minLength": 1,
            "enum": [
              "application",
              "objectType",
              "space",
              "attribute",
              "relation",
              "userRelation",
              "codelist",
              "modelChanges",
              "script",
              "mr_data",
              "workflowState",
              "creator",
              "addRelation",
              "domainTypes",
              "userAttribute"
            ],
            "type": "string"
          },
          "iconId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "iconKey": {
            "type": "string",
            "nullable": true
          },
          "orderBucketsReverse": {
            "type": "boolean",
            "nullable": true
          },
          "orderBucketsType": {
            "type": "string",
            "nullable": true
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PkgSearchTemplateFacetedParameterVM"
            },
            "nullable": true
          },
          "primaryResultText": {
            "type": "boolean",
            "nullable": true
          },
          "showSelectAllValuesCheckBox": {
            "type": "boolean",
            "nullable": true
          },
          "subFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PkgSearchTemplateFacetedBaseVM"
            },
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "valueType": {
            "enum": [
              "none",
              "isText",
              "isTranslationKey",
              "isBoolean",
              "isNumber",
              "isDate",
              "isDateTime"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PkgSearchTemplateFacetedParameterVM": {
        "required": [
          "enumKey",
          "enumKeyType"
        ],
        "type": "object",
        "properties": {
          "enumKey": {
            "minLength": 1,
            "type": "string"
          },
          "enumKeyType": {
            "minLength": 1,
            "enum": [
              "application",
              "objectType",
              "space",
              "attribute",
              "relation",
              "userRelation",
              "codelist",
              "modelChanges",
              "script",
              "mr_data",
              "workflowState",
              "creator",
              "addRelation",
              "domainTypes",
              "userAttribute"
            ],
            "type": "string"
          },
          "valueType": {
            "enum": [
              "none",
              "isText",
              "isTranslationKey",
              "isBoolean",
              "isNumber",
              "isDate",
              "isDateTime"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}