{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "urn:trafficparrot:mapping-schema:http",
  "version": "1",
  "title": "Traffic Parrot HTTP mapping",
  "description": "One Traffic Parrot HTTP mapping: the request to match and the response to send, as a JSON file in the mappings directory (mappings/*.json). A check against this schema is stricter than loading the mapping: it rejects a misspelt key, which Traffic Parrot would ignore.",
  "$comment": "gRPC mappings have their own schema, grpc-mapping.schema.json: this one plus gRPC's conventions on urlPath, method and response status. JMS, IBM MQ and file-message mappings use a different document shape. Maintainer notes: Standalone JSON Schema for a single Traffic Parrot HTTP stub mapping file (mappings/*.json), modelled on the Traffic Parrot HTTP engine plus the Traffic Parrot custom matchers. Targets the single-mapping document form; the startup loader additionally accepts a {\"mappings\": [...]} collection form not modelled here. Strictness notes: (1) top-level/request/response reject unknown properties, which the engine ignores when it loads a mapping (an unknown request key leaves a mapping that matches more requests than intended), so this schema check is what catches a misspelt key; (2) matcher objects are validated stricter than the engine, which silently ignores unknown sibling keys inside a matcher; (3) request.method is restricted to the engine's constants plus CONNECT, which the HTTP editor offers, although the engine accepts any token; (4) binaryEqualTo is modelled on the shared matcher definition but at runtime is only valid where a body is matched: request.bodyPatterns and a multipart part's bodyPatterns.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Reference to this schema for IDE support. Traffic Parrot ignores it.",
      "examples": [
        "http://localhost:8080/schemas/http-mapping.schema.json"
      ]
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the mapping. Traffic Parrot-written files carry both id and uuid with the same value.",
      "examples": [
        "0b1d4c39-6c2f-4e0e-9a51-8f2a3c5d7e90"
      ]
    },
    "uuid": {
      "type": "string",
      "format": "uuid",
      "description": "Alternative property name for the unique identifier.",
      "examples": [
        "0b1d4c39-6c2f-4e0e-9a51-8f2a3c5d7e90"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the mapping.",
      "examples": [
        "get-open-orders"
      ]
    },
    "persistent": {
      "type": "boolean",
      "description": "Whether this mapping should be persisted to disk.",
      "examples": [
        true
      ]
    },
    "priority": {
      "type": "integer",
      "minimum": 1,
      "description": "Priority of this mapping (default 5, lower number = higher priority).",
      "examples": [
        1
      ]
    },
    "scenarioName": {
      "type": "string",
      "description": "Name of the state-machine scenario this mapping belongs to (not a Traffic Parrot scenario directory).",
      "examples": [
        "order-lifecycle"
      ]
    },
    "requiredScenarioState": {
      "type": "string",
      "description": "Required scenario state for this mapping to match.",
      "examples": [
        "Started"
      ]
    },
    "newScenarioState": {
      "type": "string",
      "description": "New scenario state to set after this mapping is matched.",
      "examples": [
        "order-placed"
      ]
    },
    "insertionIndex": {
      "type": "integer",
      "description": "Internal ordering index. Accepted on input but not normally present in mapping files.",
      "examples": [
        0
      ]
    },
    "postServeActions": {
      "description": "Actions to perform after the response is served. Array form [{name, parameters}] or legacy object form {\"<name>\": {parameters}}.",
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "examples": [
                  "webhook"
                ],
                "description": "Name of the post-serve action extension to run, for example webhook."
              },
              "parameters": {
                "type": "object",
                "examples": [
                  {
                    "method": "POST",
                    "url": "http://localhost:9090/callback"
                  }
                ],
                "description": "Parameters passed to the action. Their keys depend on the action."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      ],
      "examples": [
        [
          {
            "name": "webhook",
            "parameters": {
              "method": "POST",
              "url": "http://localhost:9090/callback"
            }
          }
        ]
      ]
    },
    "serveEventListeners": {
      "type": "array",
      "description": "Serve event listeners to notify.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "webhook"
            ],
            "description": "Name of the serve event listener extension to notify, for example webhook."
          },
          "requestPhases": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "BEFORE_MATCH",
                "AFTER_MATCH",
                "BEFORE_RESPONSE_SENT",
                "AFTER_COMPLETE"
              ]
            },
            "examples": [
              [
                "AFTER_COMPLETE"
              ]
            ],
            "description": "Request phases at which the listener is called."
          },
          "parameters": {
            "type": "object",
            "examples": [
              {
                "method": "POST",
                "url": "http://localhost:9090/callback"
              }
            ],
            "description": "Parameters passed to the listener. Their keys depend on the listener."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "examples": [
        [
          {
            "name": "webhook",
            "requestPhases": [
              "AFTER_COMPLETE"
            ],
            "parameters": {
              "method": "POST",
              "url": "http://localhost:9090/callback"
            }
          }
        ]
      ]
    },
    "metadata": {
      "type": "object",
      "description": "Custom metadata associated with this mapping. Any key is accepted here.",
      "additionalProperties": true,
      "examples": [
        {
          "team": "payments",
          "ticket": "PAY-123"
        }
      ]
    },
    "request": {
      "$ref": "#/definitions/request",
      "examples": [
        {
          "method": "GET",
          "urlPath": "/orders",
          "queryParameters": {
            "status": {
              "equalTo": "open"
            }
          }
        }
      ]
    },
    "response": {
      "$ref": "#/definitions/response",
      "examples": [
        {
          "status": 200,
          "headers": {
            "Content-Type": "application/json"
          },
          "jsonBody": {
            "orders": []
          }
        }
      ]
    }
  },
  "required": [
    "request",
    "response"
  ],
  "additionalProperties": false,
  "definitions": {
    "request": {
      "type": "object",
      "description": "Request matching criteria. Use at most one of url / urlPattern / urlPath / urlPathPattern / urlPathTemplate. A misspelt key here is ignored when the mapping loads, which leaves a mapping that matches more requests than intended; a check against this schema rejects it.",
      "properties": {
        "url": {
          "type": "string",
          "description": "Exact URL including query string.",
          "examples": [
            "/orders?status=open"
          ]
        },
        "urlPattern": {
          "type": "string",
          "description": "Regex on the full URL including query string.",
          "examples": [
            "/orders/[0-9]+.*"
          ]
        },
        "urlPath": {
          "type": "string",
          "description": "Exact URL path (query string ignored).",
          "examples": [
            "/orders"
          ]
        },
        "urlPathPattern": {
          "type": "string",
          "description": "Regex on the URL path (query string ignored).",
          "examples": [
            "/orders/[0-9]+"
          ]
        },
        "urlPathTemplate": {
          "type": "string",
          "description": "RFC 6570 path template, e.g. /users/{id}. Enables pathParameters matching.",
          "examples": [
            "/orders/{orderId}"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "DELETE",
            "PATCH",
            "OPTIONS",
            "HEAD",
            "TRACE",
            "CONNECT",
            "ANY",
            "GET_OR_HEAD"
          ],
          "description": "HTTP method to match. ANY matches every method. Traffic Parrot accepts any method name when it loads a mapping; this schema accepts only the methods listed here, CONNECT among them because the HTTP editor offers it.",
          "$comment": "HTTP method to match. ANY matches every method. The engine accepts arbitrary custom method tokens; this schema restricts to the engine's constants plus CONNECT, which the HTTP editor offers.",
          "examples": [
            "GET"
          ]
        },
        "scheme": {
          "type": "string",
          "enum": [
            "http",
            "https"
          ],
          "description": "URL scheme to match.",
          "examples": [
            "https"
          ]
        },
        "host": {
          "$ref": "#/definitions/stringValueMatcherNoBodyFile",
          "description": "Matcher on the request host.",
          "examples": [
            {
              "equalTo": "api.example.com"
            }
          ]
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535,
          "description": "Port number to match.",
          "examples": [
            8443
          ]
        },
        "clientIp": {
          "$ref": "#/definitions/stringValueMatcherNoBodyFile",
          "description": "Matcher on the client IP address.",
          "examples": [
            {
              "matches": "10\\.0\\..*"
            }
          ]
        },
        "headers": {
          "type": "object",
          "description": "Request headers to match: header name to matcher (or hasExactly / includes multi-value form).",
          "additionalProperties": {
            "$ref": "#/definitions/multiValuePattern"
          },
          "examples": [
            {
              "Accept": {
                "contains": "json"
              }
            }
          ]
        },
        "queryParameters": {
          "type": "object",
          "description": "Query parameters to match.",
          "additionalProperties": {
            "$ref": "#/definitions/multiValuePattern"
          },
          "examples": [
            {
              "status": {
                "equalTo": "open"
              }
            }
          ]
        },
        "formParameters": {
          "type": "object",
          "description": "Form (application/x-www-form-urlencoded) parameters to match.",
          "additionalProperties": {
            "$ref": "#/definitions/multiValuePattern"
          },
          "examples": [
            {
              "grant_type": {
                "equalTo": "client_credentials"
              }
            }
          ]
        },
        "pathParameters": {
          "type": "object",
          "description": "Path parameters to match. Only meaningful together with urlPathTemplate.",
          "additionalProperties": {
            "$ref": "#/definitions/stringValueMatcherNoBodyFile"
          },
          "examples": [
            {
              "orderId": {
                "matches": "[0-9]+"
              }
            }
          ]
        },
        "cookies": {
          "type": "object",
          "description": "Cookies to match.",
          "additionalProperties": {
            "$ref": "#/definitions/stringValueMatcherNoBodyFile"
          },
          "examples": [
            {
              "session": {
                "matches": ".+"
              }
            }
          ]
        },
        "basicAuth": {
          "type": "object",
          "description": "Basic authentication credentials to match.",
          "properties": {
            "username": {
              "type": "string",
              "examples": [
                "api-user"
              ],
              "description": "User name the request's Basic Authorization header must carry."
            },
            "password": {
              "type": "string",
              "examples": [
                "secret"
              ],
              "description": "Password the request's Basic Authorization header must carry."
            }
          },
          "required": [
            "username",
            "password"
          ],
          "additionalProperties": false,
          "examples": [
            {
              "username": "api-user",
              "password": "secret"
            }
          ]
        },
        "bodyPatterns": {
          "type": "array",
          "description": "Request body matching patterns. All patterns must match.",
          "items": {
            "$ref": "#/definitions/stringValueMatcher"
          },
          "examples": [
            [
              {
                "matchesJsonPath": "$.items[?(@.quantity > 0)]"
              }
            ]
          ]
        },
        "multipartPatterns": {
          "type": "array",
          "description": "Multipart request body matching patterns.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "examples": [
                  "file"
                ],
                "description": "Name of the part, from its Content-Disposition header."
              },
              "fileName": {
                "type": "string",
                "examples": [
                  "invoice.pdf"
                ],
                "description": "File name of the part, from its Content-Disposition header."
              },
              "matchingType": {
                "type": "string",
                "enum": [
                  "ALL",
                  "ANY"
                ],
                "examples": [
                  "ANY"
                ],
                "description": "ALL: every part must match this pattern. ANY: at least one part must."
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/definitions/multiValuePattern"
                },
                "examples": [
                  {
                    "Content-Type": {
                      "equalTo": "application/pdf"
                    }
                  }
                ],
                "description": "Matchers the part's headers must satisfy, by header name."
              },
              "bodyPatterns": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/stringValueMatcherNoBodyFile"
                },
                "examples": [
                  [
                    {
                      "contains": "invoice"
                    }
                  ]
                ],
                "description": "Matchers the part's body must satisfy."
              }
            },
            "additionalProperties": false
          },
          "examples": [
            [
              {
                "name": "file",
                "matchingType": "ANY",
                "bodyPatterns": [
                  {
                    "contains": "invoice"
                  }
                ]
              }
            ]
          ]
        },
        "customMatcher": {
          "type": "object",
          "description": "Custom request matcher, e.g. name \"requestMatchers\" with a parameters.matchesScript Handlebars script, or parameters.matchesValidBearerToken {\"oauth2Mock\": \"<name>\"} to require a valid bearer token from a scaffolded OAuth2 mock. Several keys must all match.",
          "properties": {
            "name": {
              "type": "string",
              "examples": [
                "my-matcher"
              ],
              "description": "Name the custom request matcher extension registers itself under."
            },
            "parameters": {
              "type": "object",
              "examples": [
                {
                  "threshold": 5
                }
              ],
              "description": "Parameters passed to the custom matcher. Their keys depend on the matcher."
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false,
          "examples": [
            {
              "name": "my-matcher",
              "parameters": {
                "threshold": 5
              }
            }
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "required": [
              "url",
              "urlPattern"
            ]
          }
        },
        {
          "not": {
            "required": [
              "url",
              "urlPath"
            ]
          }
        },
        {
          "not": {
            "required": [
              "url",
              "urlPathPattern"
            ]
          }
        },
        {
          "not": {
            "required": [
              "url",
              "urlPathTemplate"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPattern",
              "urlPath"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPattern",
              "urlPathPattern"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPattern",
              "urlPathTemplate"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPath",
              "urlPathPattern"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPath",
              "urlPathTemplate"
            ]
          }
        },
        {
          "not": {
            "required": [
              "urlPathPattern",
              "urlPathTemplate"
            ]
          }
        }
      ]
    },
    "response": {
      "type": "object",
      "description": "Response definition. Use at most one of body / jsonBody / base64Body / bodyFileName.",
      "properties": {
        "status": {
          "type": "integer",
          "minimum": 0,
          "maximum": 599,
          "description": "HTTP status code (default 200). gRPC mappings reuse this field for the gRPC status code, where 0 = OK.",
          "examples": [
            200
          ]
        },
        "statusMessage": {
          "type": "string",
          "description": "HTTP status message.",
          "examples": [
            "OK"
          ]
        },
        "body": {
          "type": "string",
          "description": "Response body as text. May contain Handlebars templates when the response transformer is enabled.",
          "examples": [
            "{\"orderId\": 42, \"status\": \"open\"}"
          ]
        },
        "jsonBody": {
          "description": "Response body as inline JSON (any JSON value).",
          "examples": [
            {
              "orderId": 42,
              "status": "open"
            }
          ]
        },
        "base64Body": {
          "type": "string",
          "description": "Response body as a Base64-encoded string (for binary content).",
          "examples": [
            "SGVsbG8gd29ybGQ="
          ]
        },
        "bodyFileName": {
          "type": "string",
          "description": "Path to the file containing the response body, relative to the __files directory.",
          "examples": [
            "orders/open-orders.json"
          ]
        },
        "headers": {
          "$ref": "#/definitions/responseHeaders",
          "description": "Response headers: name to string value or array of string values.",
          "examples": [
            {
              "Content-Type": "application/json"
            }
          ]
        },
        "additionalProxyRequestHeaders": {
          "$ref": "#/definitions/responseHeaders",
          "description": "Extra headers added to the request when proxying.",
          "examples": [
            {
              "X-Forwarded-By": "traffic-parrot"
            }
          ]
        },
        "removeProxyRequestHeaders": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Header names removed from the request when proxying.",
          "examples": [
            [
              "Authorization"
            ]
          ]
        },
        "fixedDelayMilliseconds": {
          "type": "integer",
          "minimum": 0,
          "description": "Fixed delay in milliseconds before returning the response.",
          "examples": [
            250
          ]
        },
        "delayDistribution": {
          "$ref": "#/definitions/delayDistribution",
          "examples": [
            {
              "type": "lognormal",
              "median": 80,
              "sigma": 0.4
            }
          ]
        },
        "chunkedDribbleDelay": {
          "type": "object",
          "description": "Dribble the response body to the client in chunks over totalDuration milliseconds.",
          "properties": {
            "numberOfChunks": {
              "type": "integer",
              "minimum": 1,
              "examples": [
                5
              ],
              "description": "Number of chunks the response body is split into."
            },
            "totalDuration": {
              "type": "integer",
              "minimum": 1,
              "examples": [
                1000
              ],
              "description": "Time in milliseconds over which the chunks are sent."
            }
          },
          "required": [
            "numberOfChunks",
            "totalDuration"
          ],
          "additionalProperties": false,
          "examples": [
            {
              "numberOfChunks": 5,
              "totalDuration": 1000
            }
          ]
        },
        "fault": {
          "type": "string",
          "enum": [
            "CONNECTION_RESET_BY_PEER",
            "EMPTY_RESPONSE",
            "MALFORMED_RESPONSE_CHUNK",
            "RANDOM_DATA_THEN_CLOSE",
            "DRIP_BYTE_EVERY_100ms",
            "DRIP_BYTE_EVERY_1s",
            "DRIP_BYTE_EVERY_10s",
            "INCORRECT_SMALL_CONTENT_LENGTH",
            "CLOSE_CONNECTION_AFTER_HALF_RESPONSE"
          ],
          "description": "Fault to inject instead of a well-formed response. Values are case-sensitive, including the lowercase ms/s suffixes.",
          "examples": [
            "CONNECTION_RESET_BY_PEER"
          ]
        },
        "proxyBaseUrl": {
          "type": "string",
          "description": "Base URL to proxy matched requests to instead of serving a stubbed response.",
          "examples": [
            "https://api.example.com"
          ]
        },
        "proxyUrlPrefixToRemove": {
          "type": "string",
          "description": "URL prefix removed from the request path before proxying.",
          "examples": [
            "/proxy"
          ]
        },
        "transformers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Response transformer extension names to apply.",
          "examples": [
            [
              "response-template"
            ]
          ]
        },
        "transformerParameters": {
          "type": "object",
          "description": "Parameters passed to the response transformers. Any key is accepted here.",
          "additionalProperties": true,
          "examples": [
            {
              "discount": 10
            }
          ]
        },
        "fromConfiguredStub": {
          "type": "boolean",
          "description": "Whether this response came from a configured stub. Traffic Parrot writes this flag; it is not needed when writing a mapping.",
          "examples": [
            true
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "required": [
              "body",
              "jsonBody"
            ]
          }
        },
        {
          "not": {
            "required": [
              "body",
              "base64Body"
            ]
          }
        },
        {
          "not": {
            "required": [
              "body",
              "bodyFileName"
            ]
          }
        },
        {
          "not": {
            "required": [
              "jsonBody",
              "base64Body"
            ]
          }
        },
        {
          "not": {
            "required": [
              "jsonBody",
              "bodyFileName"
            ]
          }
        },
        {
          "not": {
            "required": [
              "base64Body",
              "bodyFileName"
            ]
          }
        }
      ]
    },
    "responseHeaders": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      }
    },
    "delayDistribution": {
      "description": "Random delay distribution, discriminated by type.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "lognormal",
              "examples": [
                "lognormal"
              ],
              "description": "lognormal: a random delay drawn from a log-normal distribution."
            },
            "median": {
              "type": "number",
              "minimum": 0,
              "examples": [
                80
              ],
              "description": "Median delay in milliseconds."
            },
            "sigma": {
              "type": "number",
              "minimum": 0,
              "examples": [
                0.4
              ],
              "description": "Standard deviation of the underlying normal distribution. A larger value gives a longer tail of slow responses."
            },
            "maxValue": {
              "type": "number",
              "minimum": 0,
              "examples": [
                2000
              ],
              "description": "Longest delay in milliseconds. A longer sampled delay is cut to this."
            }
          },
          "required": [
            "type",
            "median",
            "sigma"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "uniform",
              "examples": [
                "uniform"
              ],
              "description": "uniform: a random delay between lower and upper."
            },
            "lower": {
              "type": "integer",
              "minimum": 0,
              "examples": [
                50
              ],
              "description": "Shortest delay in milliseconds."
            },
            "upper": {
              "type": "integer",
              "minimum": 0,
              "examples": [
                150
              ],
              "description": "Longest delay in milliseconds."
            }
          },
          "required": [
            "type",
            "lower",
            "upper"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "fixed",
              "examples": [
                "fixed"
              ],
              "description": "fixed: the same delay every time."
            },
            "milliseconds": {
              "type": "integer",
              "minimum": 0,
              "examples": [
                250
              ],
              "description": "Delay in milliseconds."
            }
          },
          "required": [
            "type",
            "milliseconds"
          ],
          "additionalProperties": false
        }
      ]
    },
    "bodyFileRef": {
      "type": "object",
      "description": "Externalised matcher value: the expected value lives in a file under the __files directory. Accepted ONLY on a top-level request.bodyPatterns entry; Traffic Parrot rejects a bodyFileName reference in any other position (nested inside and/or/not, or on a host, clientIp, header, query, form, path, cookie or multipart matcher) with HTTP 422 at stub registration.",
      "properties": {
        "bodyFileName": {
          "type": "string",
          "examples": [
            "requests/expected-order.json"
          ],
          "description": "Name of a file under __files whose content is the matcher's value, in place of an inline value."
        }
      },
      "required": [
        "bodyFileName"
      ],
      "additionalProperties": false,
      "examples": [
        {
          "bodyFileName": "requests/expected-order.json"
        }
      ]
    },
    "noExternalisedMatcherValue": {
      "description": "Guard: forbids the externalised {\"bodyFileName\": \"<file>\"} form. Applied at every matcher position EXCEPT a top-level request.bodyPatterns entry, because those are the positions Traffic Parrot rejects with HTTP 422 at stub registration.",
      "$comment": "Guard: forbids the externalised {\"bodyFileName\": \"<file>\"} form. Applied at every matcher position EXCEPT a top-level request.bodyPatterns entry, because those are the positions the engine rejects with HTTP 422 at stub registration. This is the structural half of the restriction that bodyFileRef.description states in prose - prose alone cannot stop a generator or a validator.",
      "not": {
        "anyOf": [
          {
            "properties": {
              "equalTo": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "equalTo"
            ]
          },
          {
            "properties": {
              "equalToJson": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "equalToJson"
            ]
          },
          {
            "properties": {
              "equalToXml": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "equalToXml"
            ]
          },
          {
            "properties": {
              "matchesJsonSchema": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesJsonSchema"
            ]
          },
          {
            "properties": {
              "matchesJsonPath": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesJsonPath"
            ]
          },
          {
            "properties": {
              "matchesXPath": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesXPath"
            ]
          },
          {
            "properties": {
              "contains": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "contains"
            ]
          },
          {
            "properties": {
              "doesNotContain": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "doesNotContain"
            ]
          },
          {
            "properties": {
              "matches": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matches"
            ]
          },
          {
            "properties": {
              "doesNotMatch": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "doesNotMatch"
            ]
          },
          {
            "properties": {
              "binaryEqualTo": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "binaryEqualTo"
            ]
          },
          {
            "properties": {
              "matchesXml": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesXml"
            ]
          },
          {
            "properties": {
              "matchesJson": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesJson"
            ]
          },
          {
            "properties": {
              "matchesGraphQL": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesGraphQL"
            ]
          },
          {
            "properties": {
              "matchesSwiftField": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesSwiftField"
            ]
          },
          {
            "properties": {
              "matchesFixField": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesFixField"
            ]
          },
          {
            "properties": {
              "matchesCicsField": {
                "$ref": "#/definitions/bodyFileRef"
              }
            },
            "required": [
              "matchesCicsField"
            ]
          }
        ]
      }
    },
    "stringValueMatcherNoBodyFile": {
      "description": "A single value matcher in a position where Traffic Parrot will NOT resolve an externalised value. Identical to stringValueMatcher except that the {\"bodyFileName\": \"<file>\"} form is refused. Used for host, clientIp, header, query, form, path, cookie and multipart matchers, and for any matcher nested inside and / or / not: Traffic Parrot rejects a bodyFileName reference in all of them.",
      "allOf": [
        {
          "$ref": "#/definitions/stringValueMatcher"
        },
        {
          "$ref": "#/definitions/noExternalisedMatcherValue"
        }
      ]
    },
    "multiValuePattern": {
      "description": "Matcher for a multi-valued element (header, query or form parameter): a plain matcher on the single value, or hasExactly / includes over all values.",
      "oneOf": [
        {
          "$ref": "#/definitions/stringValueMatcherNoBodyFile"
        },
        {
          "type": "object",
          "properties": {
            "hasExactly": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/stringValueMatcherNoBodyFile"
              },
              "examples": [
                [
                  {
                    "equalTo": "red"
                  },
                  {
                    "equalTo": "blue"
                  }
                ]
              ],
              "description": "The header or parameter has exactly these values, one matching each matcher, in any order."
            }
          },
          "required": [
            "hasExactly"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "includes": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/stringValueMatcherNoBodyFile"
              },
              "examples": [
                [
                  {
                    "equalTo": "red"
                  }
                ]
              ],
              "description": "The header or parameter has, among its values, one matching each matcher."
            }
          },
          "required": [
            "includes"
          ],
          "additionalProperties": false
        }
      ]
    },
    "stringValueMatcher": {
      "type": "object",
      "description": "A single value matcher: exactly one primary matcher key plus that matcher's option keys. For equalTo, equalToJson, equalToXml, matchesJsonSchema, matchesJsonPath, matchesXPath, contains, doesNotContain, matches, doesNotMatch, binaryEqualTo and the six Traffic Parrot matchers (matchesXml, matchesJson, matchesGraphQL, matchesSwiftField, matchesFixField, matchesCicsField) the expected value may be externalised as {\"bodyFileName\": \"<file>\"}. The bodyFileName form is accepted ONLY when the matcher is a top-level request.bodyPatterns entry; in every other position (nested inside and/or/not, or on a host, clientIp, header, query, form, path, cookie or multipart matcher) Traffic Parrot rejects the stub with HTTP 422 at registration.",
      "properties": {
        "equalTo": {
          "description": "Exact string equality.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "application/json"
          ]
        },
        "caseInsensitive": {
          "type": "boolean",
          "description": "Option for equalTo.",
          "examples": [
            true
          ]
        },
        "equalToJson": {
          "description": "Semantic JSON equality. Inline JSON value, a string containing JSON, or a bodyFileName reference object.",
          "type": [
            "string",
            "object",
            "array"
          ],
          "examples": [
            {
              "orderId": 42
            }
          ]
        },
        "ignoreArrayOrder": {
          "type": "boolean",
          "description": "Option for equalToJson / matchesJson.",
          "examples": [
            true
          ]
        },
        "ignoreExtraElements": {
          "type": "boolean",
          "description": "Option for equalToJson / matchesJson.",
          "examples": [
            true
          ]
        },
        "treatNullAsAbsent": {
          "type": "boolean",
          "description": "Option for equalToJson.",
          "examples": [
            true
          ]
        },
        "matchesJsonSchema": {
          "description": "Value must validate against the given JSON Schema (inline object, string, or bodyFileName reference object).",
          "type": [
            "string",
            "object"
          ],
          "examples": [
            {
              "type": "object",
              "required": [
                "orderId"
              ]
            }
          ]
        },
        "schemaVersion": {
          "type": "string",
          "enum": [
            "V4",
            "V6",
            "V7",
            "V201909",
            "V202012"
          ],
          "description": "Option for matchesJsonSchema (default V202012).",
          "examples": [
            "V202012"
          ]
        },
        "equalToXml": {
          "description": "Semantic XML equality.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "<order><id>42</id></order>"
          ]
        },
        "enablePlaceholders": {
          "type": "boolean",
          "description": "Option for equalToXml.",
          "examples": [
            true
          ]
        },
        "placeholderOpeningDelimiterRegex": {
          "type": "string",
          "description": "Option for equalToXml.",
          "examples": [
            "\\[\\["
          ]
        },
        "placeholderClosingDelimiterRegex": {
          "type": "string",
          "description": "Option for equalToXml.",
          "examples": [
            "\\]\\]"
          ]
        },
        "exemptedComparisons": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Option for equalToXml: XMLUnit ComparisonType names to exempt, in upper case as listed. Checked only beside equalToXml, the matcher that reads it.",
          "examples": [
            [
              "NAMESPACE_URI",
              "SCHEMA_LOCATION"
            ]
          ]
        },
        "ignoreOrderOfSameNode": {
          "type": "boolean",
          "description": "Option for equalToXml.",
          "examples": [
            true
          ]
        },
        "namespaceAwareness": {
          "type": "string",
          "enum": [
            "STRICT",
            "LEGACY",
            "NONE"
          ],
          "description": "Option for equalToXml.",
          "examples": [
            "NONE"
          ]
        },
        "matchesJsonPath": {
          "description": "JSONPath expression match: a string expression, an advanced {\"expression\": ..., <sub-matcher>} object, or a bodyFileName reference object.",
          "type": [
            "string",
            "object"
          ],
          "examples": [
            "$.orderId",
            {
              "expression": "$.status",
              "equalTo": "accepted"
            }
          ]
        },
        "matchesXPath": {
          "description": "XPath expression match: a string expression, an advanced {\"expression\": ..., <sub-matcher>} object, or a bodyFileName reference object.",
          "type": [
            "string",
            "object"
          ],
          "examples": [
            "/order/id",
            {
              "expression": "/order/status/text()",
              "equalTo": "accepted"
            }
          ]
        },
        "xPathNamespaces": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Option for matchesXPath: prefix to namespace URI.",
          "examples": [
            {
              "ord": "http://example.com/orders"
            }
          ]
        },
        "contains": {
          "description": "Substring match.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "orderId"
          ]
        },
        "doesNotContain": {
          "description": "Negative substring match.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "error"
          ]
        },
        "matches": {
          "description": "Regex match.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "ORD-[0-9]+"
          ]
        },
        "doesNotMatch": {
          "description": "Negative regex match.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            ".*test.*"
          ]
        },
        "before": {
          "type": "string",
          "description": "Date-time before the given ISO-8601 instant or now-offset expression.",
          "examples": [
            "now +1 days"
          ]
        },
        "after": {
          "type": "string",
          "description": "Date-time after the given ISO-8601 instant or now-offset expression.",
          "examples": [
            "2026-01-01T00:00:00Z"
          ]
        },
        "equalToDateTime": {
          "type": "string",
          "description": "Date-time equality with the given ISO-8601 instant or now-offset expression.",
          "examples": [
            "now"
          ]
        },
        "actualFormat": {
          "type": "string",
          "description": "Option for before / after / equalToDateTime: format of the actual value.",
          "examples": [
            "dd/MM/yyyy"
          ]
        },
        "truncateExpected": {
          "type": "string",
          "description": "Option for before / after / equalToDateTime: truncate the expected date-time to this point before comparing. One of the examples, in any case, with a space or an underscore between words. Checked only beside before, after or equalToDateTime, the matchers that read it.",
          "examples": [
            "first second of minute",
            "first minute of hour",
            "first hour of day",
            "first day of month",
            "first day of next month",
            "last day of month",
            "first day of year",
            "first day of next year",
            "last day of year"
          ]
        },
        "truncateActual": {
          "type": "string",
          "description": "Option for before / after / equalToDateTime: truncate the actual date-time to this point before comparing. One of the examples, in any case, with a space or an underscore between words. Checked only beside before, after or equalToDateTime, the matchers that read it.",
          "examples": [
            "first second of minute",
            "first minute of hour",
            "first hour of day",
            "first day of month",
            "first day of next month",
            "last day of month",
            "first day of year",
            "first day of next year",
            "last day of year"
          ]
        },
        "applyTruncationLast": {
          "type": "boolean",
          "description": "Option for before / after / equalToDateTime.",
          "examples": [
            true
          ]
        },
        "expectedOffset": {
          "type": "integer",
          "description": "Option for before / after / equalToDateTime.",
          "examples": [
            1
          ]
        },
        "expectedOffsetUnit": {
          "type": "string",
          "description": "Option for before / after / equalToDateTime: the unit of expectedOffset. One of the examples, in any case.",
          "examples": [
            "SECONDS",
            "MINUTES",
            "HOURS",
            "DAYS",
            "MONTHS",
            "YEARS"
          ],
          "pattern": "^(?:[Ss][Ee][Cc][Oo][Nn][Dd][Ss]|[Mm][Ii][Nn][Uu][Tt][Ee][Ss]|[Hh][Oo][Uu][Rr][Ss]|[Dd][Aa][Yy][Ss]|[Mm][Oo][Nn][Tt][Hh][Ss]|[Yy][Ee][Aa][Rr][Ss])$"
        },
        "anything": {
          "type": "string",
          "description": "Matches any value. The operand string is ignored.",
          "examples": [
            "anything"
          ]
        },
        "absent": {
          "description": "The element must be absent. Canonically written as true; the operand value is ignored.",
          "examples": [
            true
          ]
        },
        "and": {
          "type": "array",
          "minItems": 2,
          "items": {
            "$ref": "#/definitions/stringValueMatcherNoBodyFile"
          },
          "description": "All nested matchers must match.",
          "examples": [
            [
              {
                "contains": "order"
              },
              {
                "doesNotContain": "test"
              }
            ]
          ]
        },
        "or": {
          "type": "array",
          "minItems": 2,
          "items": {
            "$ref": "#/definitions/stringValueMatcherNoBodyFile"
          },
          "description": "At least one nested matcher must match.",
          "examples": [
            [
              {
                "equalTo": "GB"
              },
              {
                "equalTo": "IE"
              }
            ]
          ]
        },
        "not": {
          "$ref": "#/definitions/stringValueMatcherNoBodyFile",
          "description": "The nested matcher must not match.",
          "examples": [
            {
              "contains": "test"
            }
          ]
        },
        "matchesPathTemplate": {
          "type": "string",
          "description": "RFC 6570 path template match (string-value sub-matcher form; the request URL role serialises as urlPathTemplate instead).",
          "examples": [
            "/orders/{orderId}"
          ]
        },
        "binaryEqualTo": {
          "description": "Byte-for-byte equality with the Base64-decoded operand. Valid only as a direct entry of request.bodyPatterns or of a multipart part's bodyPatterns, not inside an \"and\", \"or\" or \"not\" matcher, although this schema accepts it wherever a matcher is.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "SGVsbG8="
          ]
        },
        "matchesXml": {
          "description": "Traffic Parrot: XML match where element/attribute values may be regular expressions.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/definitions/bodyFileRef"
            }
          ],
          "examples": [
            "<order><id>42</id></order>"
          ]
        },
        "matchesJson": {
          "description": "Traffic Parrot: JSON match where values may be regular expressions. Inline JSON value, a string containing JSON, or a bodyFileName reference object.",
          "type": [
            "string",
            "object",
            "array"
          ],
          "examples": [
            {
              "orderId": 42
            }
          ]
        },
        "matchesGraphQL": {
          "description": "Traffic Parrot: GraphQL query match. A query string, an {\"operationName\": ..., \"variables\": ...} object, or a bodyFileName reference object.",
          "type": [
            "string",
            "object"
          ],
          "examples": [
            "{ order(id: 42) { status } }",
            {
              "operationName": "GetOrder",
              "variables": {
                "id": 42
              }
            }
          ]
        },
        "matchesSwiftField": {
          "description": "Traffic Parrot: match one field of a SWIFT MT message.",
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "examples": [
                "20"
              ],
              "description": "SWIFT MT field tag to read, for example 20 (transaction reference)."
            },
            "matches": {
              "type": "string",
              "examples": [
                "REF[0-9]+"
              ],
              "description": "Regular expression the field's value must match."
            },
            "bodyFileName": {
              "type": "string",
              "examples": [
                "requests/mt103-match.json"
              ],
              "description": "Name of a file under __files that holds this matcher's value, in place of an inline one. Use it alone."
            }
          },
          "oneOf": [
            {
              "required": [
                "field",
                "matches"
              ],
              "not": {
                "required": [
                  "bodyFileName"
                ]
              }
            },
            {
              "required": [
                "bodyFileName"
              ],
              "maxProperties": 1
            }
          ],
          "additionalProperties": false,
          "examples": [
            {
              "field": "20",
              "matches": "REF[0-9]+"
            }
          ]
        },
        "matchesFixField": {
          "description": "Traffic Parrot: match one field of a FIX message.",
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "examples": [
                "35"
              ],
              "description": "FIX tag number to read, for example 35 (MsgType)."
            },
            "matches": {
              "type": "string",
              "examples": [
                "D"
              ],
              "description": "Regular expression the tag's value must match."
            },
            "bodyFileName": {
              "type": "string",
              "examples": [
                "requests/fix-order-match.json"
              ],
              "description": "Name of a file under __files that holds this matcher's value, in place of an inline one. Use it alone."
            }
          },
          "oneOf": [
            {
              "required": [
                "field",
                "matches"
              ],
              "not": {
                "required": [
                  "bodyFileName"
                ]
              }
            },
            {
              "required": [
                "bodyFileName"
              ],
              "maxProperties": 1
            }
          ],
          "additionalProperties": false,
          "examples": [
            {
              "field": "35",
              "matches": "D"
            }
          ]
        },
        "matchesCicsField": {
          "description": "Traffic Parrot: match one field of a CICS bridge request (IBM MQ, MQFMT_CICS) by its path in the request's JSON view (MQCIH.TransactionId, ProgramName, COMMAREA.ACCOUNT-NO, COMMAREA.TXN-ENTRY[0].TXN-AMOUNT with 0-based indices), with exactly one of equalTo, matches (a whole-value regular expression), greaterThan, greaterThanOrEqualTo, lessThan or lessThanOrEqualTo. Numbers compare as numbers.",
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "examples": [
                "COMMAREA.ACCOUNT-NO"
              ],
              "description": "Path from the root of the request view, names exactly as written: ProgramName, COMMAREA.<copybook field>, MQCIH.<header field> or MQMD.UserIdentifier. A [n] after a name is a 0-based table index, as in COMMAREA.TXN-ENTRY[1].TXN-AMOUNT."
            },
            "equalTo": {
              "type": [
                "string",
                "number"
              ],
              "examples": [
                "1234567890"
              ],
              "description": "The field's value equals this."
            },
            "matches": {
              "type": "string",
              "examples": [
                "[0-9]{10}"
              ],
              "description": "Regular expression the field's value must match."
            },
            "greaterThan": {
              "type": [
                "string",
                "number"
              ],
              "examples": [
                100
              ],
              "description": "The field's numeric value is greater than this."
            },
            "greaterThanOrEqualTo": {
              "type": [
                "string",
                "number"
              ],
              "examples": [
                100
              ],
              "description": "The field's numeric value is greater than or equal to this."
            },
            "lessThan": {
              "type": [
                "string",
                "number"
              ],
              "examples": [
                1000
              ],
              "description": "The field's numeric value is less than this."
            },
            "lessThanOrEqualTo": {
              "type": [
                "string",
                "number"
              ],
              "examples": [
                1000
              ],
              "description": "The field's numeric value is less than or equal to this."
            },
            "bodyFileName": {
              "type": "string",
              "examples": [
                "requests/cics-account-match.json"
              ],
              "description": "Name of a file under __files that holds this matcher's value, in place of an inline one. Use it alone."
            }
          },
          "oneOf": [
            {
              "required": [
                "field"
              ],
              "oneOf": [
                {
                  "required": [
                    "equalTo"
                  ]
                },
                {
                  "required": [
                    "matches"
                  ]
                },
                {
                  "required": [
                    "greaterThan"
                  ]
                },
                {
                  "required": [
                    "greaterThanOrEqualTo"
                  ]
                },
                {
                  "required": [
                    "lessThan"
                  ]
                },
                {
                  "required": [
                    "lessThanOrEqualTo"
                  ]
                }
              ],
              "not": {
                "required": [
                  "bodyFileName"
                ]
              }
            },
            {
              "required": [
                "bodyFileName"
              ],
              "maxProperties": 1
            }
          ],
          "additionalProperties": false,
          "examples": [
            {
              "field": "COMMAREA.ACCOUNT-NO",
              "equalTo": "1234567890"
            }
          ]
        }
      },
      "additionalProperties": false,
      "anyOf": [
        {
          "required": [
            "equalTo"
          ]
        },
        {
          "required": [
            "equalToJson"
          ]
        },
        {
          "required": [
            "matchesJsonSchema"
          ]
        },
        {
          "required": [
            "equalToXml"
          ]
        },
        {
          "required": [
            "matchesJsonPath"
          ]
        },
        {
          "required": [
            "matchesXPath"
          ]
        },
        {
          "required": [
            "contains"
          ]
        },
        {
          "required": [
            "doesNotContain"
          ]
        },
        {
          "required": [
            "matches"
          ]
        },
        {
          "required": [
            "doesNotMatch"
          ]
        },
        {
          "required": [
            "before"
          ]
        },
        {
          "required": [
            "after"
          ]
        },
        {
          "required": [
            "equalToDateTime"
          ]
        },
        {
          "required": [
            "anything"
          ]
        },
        {
          "required": [
            "absent"
          ]
        },
        {
          "required": [
            "and"
          ]
        },
        {
          "required": [
            "or"
          ]
        },
        {
          "required": [
            "not"
          ]
        },
        {
          "required": [
            "matchesPathTemplate"
          ]
        },
        {
          "required": [
            "binaryEqualTo"
          ]
        },
        {
          "required": [
            "matchesXml"
          ]
        },
        {
          "required": [
            "matchesJson"
          ]
        },
        {
          "required": [
            "matchesGraphQL"
          ]
        },
        {
          "required": [
            "matchesSwiftField"
          ]
        },
        {
          "required": [
            "matchesFixField"
          ]
        },
        {
          "required": [
            "matchesCicsField"
          ]
        }
      ],
      "allOf": [
        {
          "if": {
            "anyOf": [
              {
                "required": [
                  "before"
                ]
              },
              {
                "required": [
                  "after"
                ]
              },
              {
                "required": [
                  "equalToDateTime"
                ]
              }
            ]
          },
          "then": {
            "properties": {
              "truncateExpected": {
                "pattern": "^(?:[Ff][Ii][Rr][Ss][Tt][ _][Ss][Ee][Cc][Oo][Nn][Dd][ _][Oo][Ff][ _][Mm][Ii][Nn][Uu][Tt][Ee]|[Ff][Ii][Rr][Ss][Tt][ _][Mm][Ii][Nn][Uu][Tt][Ee][ _][Oo][Ff][ _][Hh][Oo][Uu][Rr]|[Ff][Ii][Rr][Ss][Tt][ _][Hh][Oo][Uu][Rr][ _][Oo][Ff][ _][Dd][Aa][Yy]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Mm][Oo][Nn][Tt][Hh]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Nn][Ee][Xx][Tt][ _][Mm][Oo][Nn][Tt][Hh]|[Ll][Aa][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Mm][Oo][Nn][Tt][Hh]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Yy][Ee][Aa][Rr]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Nn][Ee][Xx][Tt][ _][Yy][Ee][Aa][Rr]|[Ll][Aa][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Yy][Ee][Aa][Rr])$"
              },
              "truncateActual": {
                "pattern": "^(?:[Ff][Ii][Rr][Ss][Tt][ _][Ss][Ee][Cc][Oo][Nn][Dd][ _][Oo][Ff][ _][Mm][Ii][Nn][Uu][Tt][Ee]|[Ff][Ii][Rr][Ss][Tt][ _][Mm][Ii][Nn][Uu][Tt][Ee][ _][Oo][Ff][ _][Hh][Oo][Uu][Rr]|[Ff][Ii][Rr][Ss][Tt][ _][Hh][Oo][Uu][Rr][ _][Oo][Ff][ _][Dd][Aa][Yy]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Mm][Oo][Nn][Tt][Hh]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Nn][Ee][Xx][Tt][ _][Mm][Oo][Nn][Tt][Hh]|[Ll][Aa][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Mm][Oo][Nn][Tt][Hh]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Yy][Ee][Aa][Rr]|[Ff][Ii][Rr][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Nn][Ee][Xx][Tt][ _][Yy][Ee][Aa][Rr]|[Ll][Aa][Ss][Tt][ _][Dd][Aa][Yy][ _][Oo][Ff][ _][Yy][Ee][Aa][Rr])$"
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "equalToXml"
            ]
          },
          "then": {
            "properties": {
              "exemptedComparisons": {
                "items": {
                  "enum": [
                    "XML_VERSION",
                    "XML_STANDALONE",
                    "XML_ENCODING",
                    "HAS_DOCTYPE_DECLARATION",
                    "DOCTYPE_NAME",
                    "DOCTYPE_PUBLIC_ID",
                    "DOCTYPE_SYSTEM_ID",
                    "SCHEMA_LOCATION",
                    "NO_NAMESPACE_SCHEMA_LOCATION",
                    "NODE_TYPE",
                    "NAMESPACE_PREFIX",
                    "NAMESPACE_URI",
                    "TEXT_VALUE",
                    "PROCESSING_INSTRUCTION_TARGET",
                    "PROCESSING_INSTRUCTION_DATA",
                    "ELEMENT_TAG_NAME",
                    "ATTR_VALUE_EXPLICITLY_SPECIFIED",
                    "ELEMENT_NUM_ATTRIBUTES",
                    "ATTR_VALUE",
                    "CHILD_NODELIST_LENGTH",
                    "CHILD_NODELIST_SEQUENCE",
                    "CHILD_LOOKUP",
                    "ATTR_NAME_LOOKUP"
                  ]
                }
              }
            }
          }
        }
      ]
    }
  }
}
