type: object
example: |
  {
    "urlPath" : "/charges",
    "method" : "POST",
    "headers" : {
      "Content-Type" : {
        "equalTo" : "application/json"
      }
    }
properties:
  scheme:
    type: string
    enum:
      - http
      - https
    description: The scheme (protocol) part of the request URL
  host:
    type: string
    description: The hostname part of the request URL
  port:
    type: integer
    minimum: 1
    maximum: 65535
    description: The HTTP port number of the request URL
  method:
    type: string
    pattern: ^[A-Z]+$
    description: The HTTP request method e.g. GET
  url:
    type: string
    description: The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
  urlPath:
    type: string
    description: The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
  urlPathPattern:
    type: string
    description: The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
  urlPattern:
    type: string
    description: The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

  pathParameters:
    type: object
    description: |
      Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only
      be used when the urlPathPattern URL match type is in use and all keys must be present as variables
      in the path template.
    additionalProperties:
      $ref: "content-pattern.yaml"

  queryParameters:
    type: object
    description: 'Query parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form'
    additionalProperties:
      $ref: "content-pattern.yaml"

  formParameters:
    type: object
    description: 'application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form'
    additionalProperties:
      $ref: "content-pattern.yaml"

  headers:
    type: object
    description: 'Header patterns to match against in the <key>: { "<predicate>": "<value>" } form'
    additionalProperties:
      $ref: "content-pattern.yaml"

  basicAuthCredentials:
    type: object
    description: Pre-emptive basic auth credentials to match against
    properties:
      password:
        type: string
      username:
        type: string
    required:
      - username
      - password
  cookies:
    type: object
    description: 'Cookie patterns to match against in the <key>: { "<predicate>": "<value>" } form'
    additionalProperties:
      $ref: "content-pattern.yaml"
  bodyPatterns:
    type: array
    description: 'Request body patterns to match against in the <key>: { "<predicate>": "<value>" } form'
    items:
      $ref: "content-pattern.yaml"

  customMatcher:
    oneOf:
      - title: Dynamic State Matcher
        description: Require the state of the Mock API to match the provided patterns. More information on this feature can be found [here](../../dynamic-state/overview).
        type: object
        properties:
          name:
            type: string
            enum: ["require-state"]
          parameters:
            type: object
            properties:
              requirements:
                type: array
                items:
                  allOf:
                    - type: object
                      properties:
                        context:
                          description: The context of the item to match. Can be templated.
                          type: string
                        key:
                          description: The key of the item to match. Cannot be templated.
                          type: string
                      required:
                        - key
                    - $ref: "#/components/schemas/content-pattern"
            required:
              - requirements
        required:
          - name
          - parameters
      - title: Data Source Matcher
        description: Fetch some data from a data source and, optionally, only match if data is found. More information on this feature can be found [here](../../data-sources/overview).
        type: object
        properties:
          name:
            type: string
            enum: ["data-exists"]
          parameters:
            type: object
            properties:
              id:
                description: The ID of the data source to query.
                type: string
                minLength: 5
                maxLength: 10
                example: jjl8y
              query:
                description: The WHERE clause to apply to the fetch query. Can be templated.
                type: string
                default: ""
              matcherEnabled:
                description: Whether the fetch query must return some data for the stub to match
                type: boolean
                default: true
            required:
              - id
        required:
          - name
          - parameters

  multipartPatterns:
    type: array
    description: Multipart patterns to match against headers and body.
    items:
      type: object
      properties:
        name:
          type: string
        matchingType:
          type: string
          description: Determines whether all or any of the parts must match the criteria for an overall match.
          default: ANY
          enum:
            - ALL
            - ANY
        headers:
          type: object
          description: 'Header patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          additionalProperties:
            $ref: "content-pattern.yaml"

        bodyPatterns:
          type: array
          description: 'Body patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          items:
            $ref: "content-pattern.yaml"
