{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://github.com/abstracta/jmeter-java-dsl/jmeter-java-dsl-cli/config-schema.json",
  "title": "cli configuration",
  "description": "Defines configuration to be used with cli",
  "type": "object",
  "properties": {
    "recorder": {
      "title": "recorder command configuration",
      "type": "object",
      "properties": {
        "url": {
          "description": "Initial URL to start recording from",
          "examples": [
            "http://myservice.com"
          ],
          "type": "string"
        },
        "workdir": {
          "description": "Directory where logs (eg: jtl files) and other relevant data is stored",
          "type": "string",
          "default": "recording"
        },
        "urlIncludes": {
          "description": "Regular expressions used to only record requests with matching URLs.\nNOTE: Don't include scheme (e.g: http://) in regex",
          "examples": [
            "[^?]*mysite.com.*"
          ],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "urlExcludes": {
          "description": "Regular expressions used to NOT record requests with matching URLs.\nNOTE: Don't include scheme (e.g: http://) in regex",
          "examples": [
            ".*google.com.*"
          ],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "urlIgnoreDefaultFilter": {
          "description": "Specifies to use or not the default URL filter. The default filter ignores URLs matching: (?i).*\\.(bmp|css|js|gif|ico|jpe?g|png|svg|swf|ttf|woff2?|webp)(\\?.*)?",
          "type": "boolean",
          "default": false
        },
        "logFilteredRequests": {
          "description": "Specifies to include in generated JTL file, filtered and not recorded requests or not.",
          "type": "boolean",
          "default": false
        },
        "headerExcludes": {
          "description": "Regular expressions used to ignore matching headers from recording",
          "examples": [
            "(?i)sec-.*"
          ],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "headerIgnoreDefaultFilter": {
          "description": "Specifies to use or not the default headers filter. The default filter ignores these headers: Accept-Language,Upgrade-Insecure-Requests,Accept-Encoding,User-Agent,Accept,Referer,Origin,X-Requested-With,Cache-Control",
          "type": "boolean",
          "default": false
        },
        "correlations": {
          "description": "Specifies list of correlation rules between requests and previous responses, avoiding fixed and brittle recorded test plans",
          "type": "array",
          "items": {
            "title": "correlation",
            "type": "object",
            "properties": {
              "variable": {
                "description": "Name of the variable used to store a value extracted from a response and to be used in a following request",
                "examples": [
                  "productId"
                ],
                "type": "string"
              },
              "extractor": {
                "description": "Defines regular expression and, optionally, other parameters which define how to extract values from responses (or even requests), to be used in following requests",
                "oneOf": [
                  {
                    "description": "Regular expression where the first capturing group defines the extracted value, while the rest is used for context matching",
                    "type": "string",
                    "examples": [
                      "name=\"productId\" value=\"([^\"]+)\""
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "regex": {
                        "description": "Regular expression where the first capturing group defines the extracted value, while the rest is used for context matching",
                        "type": "string",
                        "examples": [
                          "name=\"productId\" value=\"([^\"]+)\""
                        ]
                      },
                      "target": {
                        "description": "Specifies sample result property to apply the extractor to.\nFor details on available options check: https://javadoc.io/static/us.abstracta.jmeter/jmeter-java-dsl/1.8/us/abstracta/jmeter/javadsl/core/postprocessors/DslRegexExtractor.TargetField.html#enum.constant.summary",
                        "type": "string",
                        "enum": [
                          "RESPONSE_BODY",
                          "RESPONSE_HEADERS",
                          "REQUEST_URL",
                          "REQUEST_HEADERS",
                          "RESPONSE_BODY_UNESCAPED",
                          "RESPONSE_BODY_AS_A_DOCUMENT",
                          "RESPONSE_CODE",
                          "RESPONSE_MESSAGE"
                        ],
                        "default": "RESPONSE_BODY"
                      }
                    },
                    "required": ["regex"]
                  }
                ]
              },
              "replacement": {
                "description": "Regular expression used to replace in requests previously extracted values. The first capturing group defines the place where the extracted value should appear (and replaced by variable reference), while the rest of the regex is used for context matching",
                "examples": [
                  "productId=(.*)"
                ],
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}