All Downloads are FREE. Search and download functionalities are using the official Maven repository.

swagger.wiremock-admin-api.json Maven / Gradle / Ivy

The newest version!
{
  "openapi": "3.0.0",
  "info": {
    "title": "WireMock",
    "version": "3.9.2",
    "description": "WireMock offers a REST API for administration, troubleshooting and analysis purposes"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "tags": [
    {
      "name": "Stub Mappings",
      "description": "Operations on stub mappings",
      "externalDocs": {
        "description": "User documentation",
        "url": "https://wiremock.org/docs/stubbing/"
      }
    },
    {
      "name": "Requests",
      "description": "Logged requests and responses received by the mock service",
      "externalDocs": {
        "description": "User documentation",
        "url": "https://wiremock.org/docs/verifying/"
      }
    },
    {
      "name": "Near Misses",
      "description": "Near misses allow querying of received requests or request patterns according to similarity",
      "externalDocs": {
        "description": "User documentation",
        "url": "https://wiremock.org/docs/verifying/#near-misses"
      }
    },
    {
      "name": "Recordings",
      "description": "Stub mapping record and snapshot functions",
      "externalDocs": {
        "description": "User documentation",
        "url": "https://wiremock.org/docs/record-playback/"
      }
    },
    {
      "name": "Scenarios",
      "description": "Scenarios support modelling of stateful behaviour",
      "externalDocs": {
        "description": "User documentation",
        "url": "https://wiremock.org/docs/stateful-behaviour/"
      }
    },
    {
      "name": "Files",
      "description": "Manage the files used to support WireMock stubs"
    },
    {
      "name": "System",
      "description": "Global operations"
    }
  ],
  "externalDocs": {
    "description": "WireMock user documentation",
    "url": "https://wiremock.org/docs/"
  },
  "paths": {
    "/__admin/mappings": {
      "get": {
        "operationId": "getAllStubMappings",
        "summary": "Get all stub mappings",
        "tags": [
          "Stub Mappings"
        ],
        "parameters": [
          {
            "description": "The maximum number of results to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "example": 10,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The start index of the results to return",
            "in": "query",
            "name": "offset",
            "required": false,
            "example": 0,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stub-mappings"
                },
                "example": {
                  "meta": {
                    "total": 2
                  },
                  "mappings": [
                    {
                      "id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
                      "uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
                      "request": {
                        "method": "GET",
                        "url": "/search?q=things",
                        "headers": {
                          "Accept": {
                            "equalTo": "application/json"
                          }
                        }
                      },
                      "response": {
                        "status": 200,
                        "jsonBody": [
                          "thing1",
                          "thing2"
                        ],
                        "headers": {
                          "Content-Type": "application/json"
                        }
                      }
                    },
                    {
                      "request": {
                        "method": "POST",
                        "urlPath": "/some/things",
                        "bodyPatterns": [
                          {
                            "equalToXml": ""
                          }
                        ]
                      },
                      "response": {
                        "status": 201
                      }
                    }
                  ]
                }
              }
            },
            "description": "All stub mappings"
          }
        }
      },
      "post": {
        "operationId": "createNewStubMapping",
        "summary": "Create a new stub mapping",
        "tags": [
          "Stub Mappings"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/stubMapping"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/stubMapping"
          },
          "422": {
            "$ref": "#/components/responses/badRequestEntity"
          }
        }
      },
      "delete": {
        "operationId": "deleteAllStubMappings",
        "summary": "Delete all stub mappings",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted"
          }
        }
      }
    },
    "/__admin/mappings/reset": {
      "post": {
        "operationId": "resetStubMappings",
        "summary": "Reset stub mappings",
        "description": "Restores stub mappings to the defaults defined back in the backing store",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "description": "Successfully reset"
          }
        }
      }
    },
    "/__admin/mappings/save": {
      "post": {
        "operationId": "persistStubMappings",
        "summary": "Persist stub mappings",
        "description": "Save all persistent stub mappings to the backing store",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "description": "Successfully saved"
          }
        }
      }
    },
    "/__admin/mappings/import": {
      "post": {
        "operationId": "importStubMappings",
        "summary": "Import stub mappings",
        "description": "Import given stub mappings to the backing store",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "description": "Successfully imported"
          }
        }
      }
    },
    "/__admin/mappings/{stubMappingId}": {
      "parameters": [
        {
          "description": "The UUID of stub mapping",
          "in": "path",
          "name": "stubMappingId",
          "required": true,
          "example": "730d3e32-d098-4169-a20c-554c3bedce58",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getStubMappingById",
        "summary": "Get stub mapping by ID",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/stubMapping"
          },
          "404": {
            "description": "Stub mapping not found"
          }
        }
      },
      "put": {
        "operationId": "updateStubMapping",
        "summary": "Update a stub mapping",
        "tags": [
          "Stub Mappings"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/stubMapping"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/stubMapping"
          },
          "404": {
            "description": "Stub mapping not found"
          }
        }
      },
      "delete": {
        "operationId": "deleteStubMapping",
        "summary": "Delete a stub mapping",
        "tags": [
          "Stub Mappings"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Stub mapping not found"
          }
        }
      }
    },
    "/__admin/mappings/find-by-metadata": {
      "post": {
        "operationId": "findStubMappingsByMetadata",
        "description": "Find stubs by matching on their metadata",
        "tags": [
          "Stub Mappings"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/content-pattern"
              },
              "example": {
                "matchesJsonPath": {
                  "expression": "$.outer",
                  "equalToJson": "{ \"inner\": 42 }"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stub-mappings"
                },
                "example": {
                  "meta": {
                    "total": 2
                  },
                  "mappings": [
                    {
                      "id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
                      "uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
                      "request": {
                        "method": "GET",
                        "url": "/search?q=things",
                        "headers": {
                          "Accept": {
                            "equalTo": "application/json"
                          }
                        }
                      },
                      "response": {
                        "status": 200,
                        "jsonBody": [
                          "thing1",
                          "thing2"
                        ],
                        "headers": {
                          "Content-Type": "application/json"
                        }
                      }
                    },
                    {
                      "request": {
                        "method": "POST",
                        "urlPath": "/some/things",
                        "bodyPatterns": [
                          {
                            "equalToXml": ""
                          }
                        ]
                      },
                      "response": {
                        "status": 201
                      }
                    }
                  ]
                }
              }
            },
            "description": "Matched stub mappings"
          }
        }
      }
    },
    "/__admin/mappings/remove-by-metadata": {
      "post": {
        "operationId": "removeStubMappingsByMetadata",
        "summary": "Delete stub mappings matching metadata",
        "tags": [
          "Stub Mappings"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/content-pattern"
              },
              "example": {
                "matchesJsonPath": {
                  "expression": "$.outer",
                  "equalToJson": "{ \"inner\": 42 }"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stub mappings were successfully removed"
          }
        }
      }
    },
    "/__admin/requests": {
      "get": {
        "operationId": "getAllRequestsInJournal",
        "summary": "Get all requests in journal",
        "tags": [
          "Requests"
        ],
        "parameters": [
          {
            "description": "The maximum number of results to return",
            "in": "query",
            "name": "limit",
            "example": 10,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only return logged requests after this date",
            "in": "query",
            "name": "since",
            "example": "2016-10-05T12:33:01Z",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "requests": [
                    {
                      "id": "45760a03-eebb-4387-ad0d-bb89b5d3d662",
                      "request": {
                        "url": "/received-request/9",
                        "absoluteUrl": "http://localhost:56715/received-request/9",
                        "method": "GET",
                        "clientIp": "127.0.0.1",
                        "headers": {
                          "Connection": "keep-alive",
                          "Host": "localhost:56715",
                          "User-Agent": "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
                        },
                        "cookies": {},
                        "browserProxyRequest": false,
                        "loggedDate": 1471442494809,
                        "bodyAsBase64": "",
                        "body": "",
                        "loggedDateString": "2016-08-17T14:01:34Z"
                      },
                      "responseDefinition": {
                        "status": 404,
                        "transformers": [],
                        "fromConfiguredStub": false,
                        "transformerParameters": {}
                      }
                    },
                    {
                      "id": "6ae78311-0178-46c9-987a-fbfc528d54d8",
                      "request": {
                        "url": "/received-request/8",
                        "absoluteUrl": "http://localhost:56715/received-request/8",
                        "method": "GET",
                        "clientIp": "127.0.0.1",
                        "headers": {
                          "Connection": "keep-alive",
                          "Host": "localhost:56715",
                          "User-Agent": "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
                        },
                        "cookies": {},
                        "browserProxyRequest": false,
                        "loggedDate": 1471442494802,
                        "bodyAsBase64": "",
                        "body": "",
                        "loggedDateString": "2016-08-17T14:01:34Z"
                      },
                      "responseDefinition": {
                        "status": 404,
                        "transformers": [],
                        "fromConfiguredStub": false,
                        "transformerParameters": {}
                      }
                    },
                    {
                      "id": "aba8e4ad-1b5b-4518-8f05-b2170a24de35",
                      "request": {
                        "url": "/received-request/7",
                        "absoluteUrl": "http://localhost:56715/received-request/7",
                        "method": "GET",
                        "clientIp": "127.0.0.1",
                        "headers": {
                          "Connection": "keep-alive",
                          "Host": "localhost:56715",
                          "User-Agent": "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
                        },
                        "cookies": {},
                        "browserProxyRequest": false,
                        "loggedDate": 1471442494795,
                        "bodyAsBase64": "",
                        "body": "",
                        "loggedDateString": "2016-08-17T14:01:34Z"
                      },
                      "responseDefinition": {
                        "status": 404,
                        "transformers": [],
                        "fromConfiguredStub": false,
                        "transformerParameters": {}
                      }
                    }
                  ],
                  "meta": {
                    "total": 9
                  },
                  "requestJournalDisabled": false
                }
              }
            },
            "description": "List of received requests"
          }
        }
      },
      "delete": {
        "operationId": "deleteAllRequestsInJournal",
        "summary": "Delete all requests in journal",
        "tags": [
          "Requests"
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted"
          }
        }
      }
    },
    "/__admin/requests/{requestId}": {
      "get": {
        "operationId": "getRequestById",
        "summary": "Get request by ID",
        "tags": [
          "Requests"
        ],
        "parameters": [
          {
            "description": "The UUID of the logged request",
            "in": "path",
            "name": "requestId",
            "required": true,
            "example": "12fb14bb-600e-4bfa-bd8d-be7f12562c99",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "id": "12fb14bb-600e-4bfa-bd8d-be7f12562c99",
                  "request": {
                    "url": "/received-request/2",
                    "absoluteUrl": "http://localhost:56738/received-request/2",
                    "method": "GET",
                    "clientIp": "127.0.0.1",
                    "headers": {
                      "Connection": "keep-alive",
                      "Host": "localhost:56738",
                      "User-Agent": "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
                    },
                    "cookies": {},
                    "browserProxyRequest": false,
                    "loggedDate": 1471442557047,
                    "bodyAsBase64": "",
                    "body": "",
                    "loggedDateString": "2016-08-17T14:02:37Z"
                  },
                  "responseDefinition": {
                    "status": 404,
                    "transformers": [],
                    "fromConfiguredStub": false,
                    "transformerParameters": {}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request not found"
          }
        }
      },
      "delete": {
        "operationId": "deleteRequestById",
        "summary": "Delete request by ID",
        "tags": [
          "Requests"
        ],
        "parameters": [
          {
            "description": "The UUID of the logged request",
            "in": "path",
            "name": "requestId",
            "required": true,
            "example": "12fb14bb-600e-4bfa-bd8d-be7f12562c99",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted"
          }
        }
      }
    },
    "/__admin/requests/reset": {
      "post": {
        "operationId": "emptyRequestJournal",
        "deprecated": true,
        "summary": "Empty the request journal",
        "tags": [
          "Requests"
        ],
        "responses": {
          "200": {
            "description": "Successfully reset"
          }
        }
      }
    },
    "/__admin/requests/count": {
      "post": {
        "operationId": "countRequestsByCriteria",
        "summary": "Count requests by criteria",
        "description": "Count requests logged in the journal matching the specified criteria",
        "tags": [
          "Requests"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/requestPattern"
        },
        "responses": {
          "200": {
            "description": "Number of matching requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "example": 4
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/__admin/requests/remove": {
      "post": {
        "operationId": "removeRequestsByCriteria",
        "summary": "Remove requests by criteria",
        "description": "Removed requests logged in the journal matching the specified criteria",
        "tags": [
          "Requests"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/requestPattern"
        },
        "responses": {
          "200": {
            "description": "Removed request details",
            "content": {
              "application/json": {
                "example": {
                  "requests": [
                    {
                      "url": "/my/url",
                      "absoluteUrl": "http://mydomain.com/my/url",
                      "method": "GET",
                      "headers": {
                        "Accept-Language": "en-us,en;q=0.5",
                        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
                        "Accept": "image/png,image/*;q=0.8,*/*;q=0.5"
                      },
                      "body": "",
                      "browserProxyRequest": true,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    },
                    {
                      "url": "/my/other/url",
                      "absoluteUrl": "http://my.other.domain.com/my/other/url",
                      "method": "POST",
                      "headers": {
                        "Accept": "text/plain",
                        "Content-Type": "text/plain"
                      },
                      "body": "My text",
                      "browserProxyRequest": false,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/__admin/requests/remove-by-metadata": {
      "post": {
        "operationId": "removeRequestsByMetadata",
        "summary": "Delete requests mappings matching metadata",
        "tags": [
          "Requests"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/content-pattern"
              },
              "example": {
                "matchesJsonPath": {
                  "expression": "$.outer",
                  "equalToJson": "{ \"inner\": 42 }"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed request details",
            "content": {
              "application/json": {
                "example": {
                  "requests": [
                    {
                      "url": "/my/url",
                      "absoluteUrl": "http://mydomain.com/my/url",
                      "method": "GET",
                      "headers": {
                        "Accept-Language": "en-us,en;q=0.5",
                        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
                        "Accept": "image/png,image/*;q=0.8,*/*;q=0.5"
                      },
                      "body": "",
                      "browserProxyRequest": true,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    },
                    {
                      "url": "/my/other/url",
                      "absoluteUrl": "http://my.other.domain.com/my/other/url",
                      "method": "POST",
                      "headers": {
                        "Accept": "text/plain",
                        "Content-Type": "text/plain"
                      },
                      "body": "My text",
                      "browserProxyRequest": false,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/__admin/requests/find": {
      "post": {
        "operationId": "findRequestsByCriteria",
        "summary": "Find requests by criteria",
        "description": "Retrieve details of requests logged in the journal matching the specified criteria",
        "tags": [
          "Requests"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/requestPattern"
        },
        "responses": {
          "200": {
            "description": "Matching request details",
            "content": {
              "application/json": {
                "example": {
                  "requests": [
                    {
                      "url": "/my/url",
                      "absoluteUrl": "http://mydomain.com/my/url",
                      "method": "GET",
                      "headers": {
                        "Accept-Language": "en-us,en;q=0.5",
                        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
                        "Accept": "image/png,image/*;q=0.8,*/*;q=0.5"
                      },
                      "body": "",
                      "browserProxyRequest": true,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    },
                    {
                      "url": "/my/other/url",
                      "absoluteUrl": "http://my.other.domain.com/my/other/url",
                      "method": "POST",
                      "headers": {
                        "Accept": "text/plain",
                        "Content-Type": "text/plain"
                      },
                      "body": "My text",
                      "browserProxyRequest": false,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/__admin/requests/unmatched": {
      "get": {
        "operationId": "findUnmatchedRequests",
        "summary": "Find unmatched requests",
        "description": "Get details of logged requests that weren't matched by any stub mapping",
        "tags": [
          "Requests"
        ],
        "responses": {
          "200": {
            "description": "Unmatched request details",
            "content": {
              "application/json": {
                "example": {
                  "requests": [
                    {
                      "url": "/my/url",
                      "absoluteUrl": "http://mydomain.com/my/url",
                      "method": "GET",
                      "headers": {
                        "Accept-Language": "en-us,en;q=0.5",
                        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
                        "Accept": "image/png,image/*;q=0.8,*/*;q=0.5"
                      },
                      "body": "",
                      "browserProxyRequest": true,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    },
                    {
                      "url": "/my/other/url",
                      "absoluteUrl": "http://my.other.domain.com/my/other/url",
                      "method": "POST",
                      "headers": {
                        "Accept": "text/plain",
                        "Content-Type": "text/plain"
                      },
                      "body": "My text",
                      "browserProxyRequest": false,
                      "loggedDate": 1339083581823,
                      "loggedDateString": "2012-06-07 16:39:41"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/__admin/requests/unmatched/near-misses": {
      "get": {
        "operationId": "retrieveNearMissesForUnmatchedRequests",
        "description": "Retrieve near-misses for all unmatched requests",
        "tags": [
          "Near Misses"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/nearMisses"
          }
        }
      }
    },
    "/__admin/near-misses/request": {
      "post": {
        "operationId": "findNearMissesForRequest",
        "summary": "Find near misses matching specific request",
        "description": "Find at most 3 near misses for closest stub mappings to the specified request",
        "tags": [
          "Near Misses"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/logged-request"
              },
              "example": {
                "url": "/actual",
                "absoluteUrl": "http://localhost:8080/actual",
                "method": "GET",
                "clientIp": "0:0:0:0:0:0:0:1",
                "headers": {
                  "User-Agent": "curl/7.30.0",
                  "Accept": "*/*",
                  "Host": "localhost:8080"
                },
                "cookies": {},
                "browserProxyRequest": false,
                "loggedDate": 1467402464520,
                "bodyAsBase64": "",
                "body": "",
                "loggedDateString": "2016-07-01T19:47:44Z"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/nearMisses"
          }
        }
      }
    },
    "/__admin/near-misses/request-pattern": {
      "post": {
        "operationId": "findNearMissesForRequestPattern",
        "summary": "Find near misses matching request pattern",
        "description": "Find at most 3 near misses for closest logged requests to the specified request pattern",
        "tags": [
          "Near Misses"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/requestPattern"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/nearMisses"
          }
        }
      }
    },
    "/__admin/recordings/start": {
      "post": {
        "operationId": "startRecording",
        "summary": "Start recording",
        "description": "Begin recording stub mappings",
        "tags": [
          "Recordings"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/startRecording"
        },
        "responses": {
          "200": {
            "description": "Successfully started recording"
          }
        }
      }
    },
    "/__admin/recordings/stop": {
      "post": {
        "operationId": "stopRecording",
        "summary": "Stop recording",
        "description": "End recording of stub mappings",
        "tags": [
          "Recordings"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stub-mappings"
                },
                "example": {
                  "mappings": [
                    {
                      "id": "093f1027-e5e0-4921-9e6d-e619dfd5d2c7",
                      "name": "recordables_123",
                      "request": {
                        "url": "/recordables/123",
                        "method": "GET"
                      },
                      "response": {
                        "status": 200,
                        "body": "{\n  \"message\": \"Congratulations on your first recording!\"\n}",
                        "headers": {
                          "Content-Type": "application/json"
                        }
                      },
                      "uuid": "093f1027-e5e0-4921-9e6d-e619dfd5d2c7",
                      "persistent": true
                    }
                  ]
                }
              }
            },
            "description": "Successfully stopped recording"
          }
        }
      }
    },
    "/__admin/recordings/status": {
      "get": {
        "operationId": "getRecordingStatus",
        "summary": "Get recording status",
        "tags": [
          "Recordings"
        ],
        "responses": {
          "200": {
            "description": "Successfully got the record status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "Stopped",
                      "enum": [
                        "NeverStarted",
                        "Recording",
                        "Stopped"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/__admin/recordings/snapshot": {
      "post": {
        "operationId": "takeRecordingSnapshot",
        "summary": "Take a snapshot recording",
        "tags": [
          "Recordings"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/snapshotRecording"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/stub-mappings"
                },
                "example": {
                  "mappings": [
                    {
                      "id": "093f1027-e5e0-4921-9e6d-e619dfd5d2c7",
                      "name": "recordables_123",
                      "request": {
                        "url": "/recordables/123",
                        "method": "GET"
                      },
                      "response": {
                        "status": 200,
                        "body": "{\n  \"message\": \"Congratulations on your first recording!\"\n}",
                        "headers": {
                          "Content-Type": "application/json"
                        }
                      },
                      "uuid": "093f1027-e5e0-4921-9e6d-e619dfd5d2c7",
                      "persistent": true
                    }
                  ]
                }
              }
            },
            "description": "Successfully took a snapshot recording"
          }
        }
      }
    },
    "/__admin/scenarios": {
      "get": {
        "operationId": "getAllScenarios",
        "summary": "Get all scenarios",
        "tags": [
          "Scenarios"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scenarios": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/scenario"
                      }
                    }
                  }
                }
              }
            },
            "description": "All scenarios"
          }
        }
      }
    },
    "/__admin/scenarios/reset": {
      "post": {
        "operationId": "resetAllScenarios",
        "summary": "Reset the state of all scenarios",
        "tags": [
          "Scenarios"
        ],
        "responses": {
          "200": {
            "description": "Successfully reset"
          }
        }
      }
    },
    "/__admin/files": {
      "get": {
        "operationId": "getAllFileNames",
        "summary": "Get all file names",
        "tags": [
          "Files"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "example": [
                    "file1.json",
                    "file2.json",
                    "file3.txt"
                  ]
                }
              }
            },
            "description": "All scenarios"
          }
        }
      }
    },
    "/__admin/files/{fileId}": {
      "parameters": [
        {
          "description": "The name of the file",
          "in": "path",
          "name": "fileId",
          "required": true,
          "example": "file1.json",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getFileById",
        "summary": "Get file by ID",
        "tags": [
          "Files"
        ],
        "responses": {
          "200": {
            "description": "The contents of the file"
          },
          "404": {
            "description": "File not found"
          }
        }
      },
      "put": {
        "operationId": "updateFileById",
        "summary": "Update or create a file",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "byte"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK - contents of the request body as a string"
          }
        }
      },
      "delete": {
        "operationId": "deleteFileById",
        "summary": "Delete a file if it exists",
        "tags": [
          "Files"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/__admin/settings": {
      "post": {
        "operationId": "updateGlobalSettings",
        "summary": "Update global settings",
        "tags": [
          "System"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/delay-distribution"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "fixedDelay": {
                        "type": "number"
                      }
                    },
                    "example": {
                      "fixedDelay": 500
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings successfully updated"
          }
        }
      }
    },
    "/__admin/reset": {
      "post": {
        "operationId": "resetMappingsAndJournal",
        "summary": "Reset mappings and request journal",
        "description": "Reset mappings to the default state and reset the request journal",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Successfully reset"
          }
        }
      }
    },
    "/__admin/shutdown": {
      "post": {
        "operationId": "shutdownServer",
        "summary": "Shutdown the WireMock server",
        "description": "Shutdown the WireMock server",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Server will be shut down"
          }
        }
      }
    },
    "/__admin/version": {
      "get": {
        "operationId": "getVersion",
        "summary": "Return the version of the WireMock server",
        "description": "Returns the version of the WireMock server",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Successfully returned the version of the WireMock server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "example": "3.8.0"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/__admin/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Return the health of the WireMock server",
        "description": "Returns the health of the WireMock server",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Successful health and uptime data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/health"
                },
                "example": {
                  "status": "healthy",
                  "message": "Wiremock is ok",
                  "version": "3.8.0",
                  "uptimeInSeconds": 14355,
                  "timestamp": "2024-07-03T13:16:06.172362Z"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "requestBodies": {
      "requestPattern": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/request-pattern"
            },
            "example": {
              "method": "POST",
              "url": "/resource",
              "headers": {
                "Content-Type": {
                  "matches": ".*/xml"
                }
              }
            }
          }
        }
      },
      "stubMapping": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/stub-mapping"
            },
            "example": {
              "request": {
                "method": "GET",
                "url": "/some/thing"
              },
              "response": {
                "body": "Hello world!",
                "headers": {
                  "Content-Type": "text/plain"
                },
                "status": 200
              }
            }
          }
        }
      },
      "startRecording": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/record-spec"
                },
                {
                  "properties": {
                    "filters": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/request-pattern"
                        },
                        {
                          "description": "Filter requests for which to create stub mapping"
                        }
                      ]
                    },
                    "targetBaseUrl": {
                      "type": "string",
                      "description": "Target URL when using the record and playback API",
                      "example": "https://example.wiremock.org"
                    }
                  }
                }
              ]
            },
            "example": {
              "targetBaseUrl": "http://example.mocklab.io",
              "filters": {
                "urlPathPattern": "/api/.*",
                "method": "GET"
              },
              "captureHeaders": {
                "Accept": {},
                "Content-Type": {
                  "caseInsensitive": true
                }
              },
              "requestBodyPattern": {
                "matcher": "equalToJson",
                "ignoreArrayOrder": false,
                "ignoreExtraElements": true
              },
              "extractBodyCriteria": {
                "textSizeThreshold": "2048",
                "binarySizeThreshold": "10240"
              },
              "persist": false,
              "repeatsAsScenarios": false,
              "transformers": [
                "modify-response-header"
              ],
              "transformerParameters": {
                "headerValue": "123"
              }
            }
          }
        }
      },
      "snapshotRecording": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "allOf": [
                {
                  "$ref": "#/components/schemas/record-spec"
                },
                {
                  "properties": {
                    "filters": {
                      "type": "object",
                      "allOf": [
                        {
                          "properties": {
                            "ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "type": "object",
                          "description": "Filter requests for which to create stub mapping"
                        },
                        {
                          "$ref": "#/components/schemas/request-pattern"
                        }
                      ]
                    }
                  }
                }
              ]
            },
            "example": {
              "filters": {
                "urlPathPattern": "/api/.*",
                "method": "GET",
                "ids": [
                  "40a93c4a-d378-4e07-8321-6158d5dbcb29"
                ]
              },
              "captureHeaders": {
                "Accept": {},
                "Content-Type": {
                  "caseInsensitive": true
                }
              },
              "requestBodyPattern": {
                "matcher": "equalToJson",
                "ignoreArrayOrder": false,
                "ignoreExtraElements": true
              },
              "extractBodyCriteria": {
                "textSizeThreshold": "2 kb",
                "binarySizeThreshold": "1 Mb"
              },
              "outputFormat": "FULL",
              "persist": false,
              "repeatsAsScenarios": false,
              "transformers": [
                "modify-response-header"
              ],
              "transformerParameters": {
                "headerValue": "123"
              }
            }
          }
        }
      }
    },
    "responses": {
      "stubMapping": {
        "description": "The stub mapping",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/stub-mapping"
            },
            "example": {
              "id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
              "priority": 3,
              "request": {
                "headers": {
                  "Accept": {
                    "equalTo": "text/plain"
                  }
                },
                "method": "GET",
                "url": "/some/thing"
              },
              "response": {
                "body": "Hello world!",
                "headers": {
                  "Content-Type": "text/plain"
                },
                "status": 200
              }
            }
          }
        }
      },
      "nearMisses": {
        "description": "Near misses matching criteria",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "nearMisses": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/logged-request"
                  }
                }
              }
            },
            "example": {
              "nearMisses": [
                {
                  "request": {
                    "url": "/nomatch",
                    "absoluteUrl": "http://localhost:8080/nomatch",
                    "method": "GET",
                    "clientIp": "0:0:0:0:0:0:0:1",
                    "headers": {
                      "User-Agent": "curl/7.30.0",
                      "Accept": "*/*",
                      "Host": "localhost:8080"
                    },
                    "cookies": {},
                    "browserProxyRequest": false,
                    "loggedDate": 1467402464520,
                    "bodyAsBase64": "",
                    "body": "",
                    "loggedDateString": "2016-07-01T19:47:44Z"
                  },
                  "requestPattern": {
                    "url": "/almostmatch",
                    "method": "GET"
                  },
                  "matchResult": {
                    "distance": 0.06944444444444445
                  }
                }
              ]
            }
          }
        }
      },
      "badRequestEntity": {
        "description": "Bad request body",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/bad-request-entity"
            }
          }
        }
      }
    },
    "schemas": {
      "equal-to-pattern": {
        "title": "String equals",
        "type": "object",
        "required": [
          "equalTo"
        ],
        "properties": {
          "equalTo": {
            "type": "string"
          },
          "caseInsensitive": {
            "type": "boolean"
          }
        }
      },
      "base64-string": {
        "title": "Base64 string",
        "type": "string",
        "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
        "description": "A base64 encoded string used to describe binary data."
      },
      "binary-equal-to-pattern": {
        "title": "Binary equals",
        "type": "object",
        "required": [
          "binaryEqualTo"
        ],
        "properties": {
          "binaryEqualTo": {
            "$ref": "#/components/schemas/base64-string"
          }
        }
      },
      "contains-pattern": {
        "title": "String contains",
        "type": "object",
        "properties": {
          "contains": {
            "type": "string"
          }
        },
        "required": [
          "contains"
        ]
      },
      "does-not-contain-pattern": {
        "title": "String does not contain",
        "type": "object",
        "properties": {
          "doesNotContain": {
            "type": "string"
          }
        },
        "required": [
          "doesNotContain"
        ]
      },
      "matches-pattern": {
        "title": "Regular expression match",
        "type": "object",
        "properties": {
          "matches": {
            "type": "string"
          }
        },
        "required": [
          "matches"
        ]
      },
      "does-not-match-pattern": {
        "title": "Negative regular expression match",
        "type": "object",
        "properties": {
          "doesNotMatch": {
            "type": "string"
          }
        },
        "required": [
          "doesNotMatch"
        ]
      },
      "content-pattern": {
        "type": "object",
        "title": "Content pattern",
        "oneOf": [
          {
            "$ref": "#/components/schemas/equal-to-pattern"
          },
          {
            "$ref": "#/components/schemas/binary-equal-to-pattern"
          },
          {
            "$ref": "#/components/schemas/contains-pattern"
          },
          {
            "$ref": "#/components/schemas/does-not-contain-pattern"
          },
          {
            "$ref": "#/components/schemas/matches-pattern"
          },
          {
            "$ref": "#/components/schemas/does-not-match-pattern"
          },
          {
            "$ref": "#/components/schemas/not-pattern"
          },
          {
            "$ref": "#/components/schemas/before-pattern"
          },
          {
            "$ref": "#/components/schemas/after-pattern"
          },
          {
            "$ref": "#/components/schemas/equal-to-date-time-pattern"
          },
          {
            "$ref": "#/components/schemas/equal-to-json-pattern"
          },
          {
            "$ref": "#/components/schemas/matches-json-path-pattern"
          },
          {
            "$ref": "#/components/schemas/equal-to-xml-pattern"
          },
          {
            "$ref": "#/components/schemas/matches-xpath-pattern"
          },
          {
            "$ref": "#/components/schemas/matches-json-schema-pattern"
          },
          {
            "$ref": "#/components/schemas/absent-pattern"
          },
          {
            "$ref": "#/components/schemas/and-pattern"
          },
          {
            "$ref": "#/components/schemas/or-pattern"
          },
          {
            "$ref": "#/components/schemas/has-exactly-multivalue-pattern"
          },
          {
            "$ref": "#/components/schemas/includes-multivalue-pattern"
          }
        ]
      },
      "not-pattern": {
        "title": "NOT modifier",
        "type": "object",
        "properties": {
          "not": {
            "$ref": "#/components/schemas/content-pattern"
          }
        },
        "required": [
          "not"
        ]
      },
      "dateTimeExpression": {
        "type": "string",
        "example": "now +3 days"
      },
      "format": {
        "type": "string",
        "example": "yyyy-MM-dd"
      },
      "truncation": {
        "type": "string",
        "enum": [
          "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"
        ],
        "example": "first day of month"
      },
      "before-pattern": {
        "title": "Before datetime",
        "type": "object",
        "properties": {
          "before": {
            "$ref": "#/components/schemas/dateTimeExpression"
          },
          "actualFormat": {
            "$ref": "#/components/schemas/format"
          },
          "truncateExpected": {
            "$ref": "#/components/schemas/truncation"
          },
          "truncateActual": {
            "$ref": "#/components/schemas/truncation"
          }
        },
        "required": [
          "before"
        ]
      },
      "after-pattern": {
        "title": "Before datetime",
        "type": "object",
        "properties": {
          "after": {
            "$ref": "#/components/schemas/dateTimeExpression"
          },
          "actualFormat": {
            "$ref": "#/components/schemas/format"
          },
          "truncateExpected": {
            "$ref": "#/components/schemas/truncation"
          },
          "truncateActual": {
            "$ref": "#/components/schemas/truncation"
          }
        },
        "required": [
          "after"
        ]
      },
      "equal-to-date-time-pattern": {
        "title": "Before datetime",
        "type": "object",
        "properties": {
          "equalToDateTime": {
            "$ref": "#/components/schemas/dateTimeExpression"
          },
          "actualFormat": {
            "$ref": "#/components/schemas/format"
          },
          "truncateExpected": {
            "$ref": "#/components/schemas/truncation"
          },
          "truncateActual": {
            "$ref": "#/components/schemas/truncation"
          }
        },
        "required": [
          "equalToDateTime"
        ]
      },
      "equal-to-json-pattern": {
        "title": "JSON equals",
        "type": "object",
        "properties": {
          "equalToJson": {
            "type": "string",
            "example": "{ \"message\": \"hello\" }\n"
          },
          "ignoreExtraElements": {
            "type": "boolean"
          },
          "ignoreArrayOrder": {
            "type": "boolean"
          }
        },
        "required": [
          "equalToJson"
        ]
      },
      "matches-json-path-pattern": {
        "title": "JSONPath match",
        "type": "object",
        "properties": {
          "matchesJsonPath": {
            "oneOf": [
              {
                "type": "string",
                "example": "$.name"
              },
              {
                "type": "object",
                "allOf": [
                  {
                    "properties": {
                      "expression": {
                        "type": "string",
                        "example": "$.name"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/content-pattern"
                  }
                ],
                "required": [
                  "expression"
                ]
              }
            ]
          }
        },
        "required": [
          "matchesJsonPath"
        ]
      },
      "equal-to-xml-pattern": {
        "title": "XML equality",
        "type": "object",
        "properties": {
          "equalToXml": {
            "type": "string",
            "example": "123"
          },
          "enablePlaceholders": {
            "type": "boolean"
          },
          "placeholderOpeningDelimiterRegex": {
            "type": "string",
            "example": "["
          },
          "placeholderClosingDelimiterRegex": {
            "type": "string",
            "example": "]"
          }
        },
        "required": [
          "equalToXml"
        ]
      },
      "matches-xpath-pattern": {
        "title": "XPath match",
        "type": "object",
        "properties": {
          "matchesXPath": {
            "oneOf": [
              {
                "type": "string",
                "example": "//Order/Amount"
              },
              {
                "type": "object",
                "allOf": [
                  {
                    "properties": {
                      "expression": {
                        "type": "string",
                        "example": "//Order/Amount"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/content-pattern"
                  }
                ],
                "required": [
                  "expression"
                ]
              }
            ]
          },
          "xPathNamespaces": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "matchesXPath"
        ]
      },
      "matches-json-schema-pattern": {
        "title": "JSON Schema match",
        "type": "object",
        "properties": {
          "matchesJsonSchema": {
            "oneOf": [
              {
                "type": "string",
                "example": "//Order/Amount"
              },
              {
                "type": "object",
                "allOf": [
                  {
                    "properties": {
                      "expression": {
                        "type": "string",
                        "example": "//Order/Amount"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/content-pattern"
                  }
                ],
                "required": [
                  "expression"
                ]
              }
            ]
          },
          "xPathNamespaces": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "matchesJsonSchema"
        ]
      },
      "absent-pattern": {
        "title": "Absent matcher",
        "type": "object",
        "properties": {
          "absent": {
            "type": "boolean"
          }
        },
        "required": [
          "absent"
        ]
      },
      "and-pattern": {
        "title": "Logical AND matcher",
        "type": "object",
        "properties": {
          "and": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/content-pattern"
            }
          }
        },
        "required": [
          "and"
        ]
      },
      "or-pattern": {
        "title": "Logical AND matcher",
        "type": "object",
        "properties": {
          "or": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/content-pattern"
            }
          }
        },
        "required": [
          "or"
        ]
      },
      "has-exactly-multivalue-pattern": {
        "title": "Has exactly multi value matcher",
        "type": "object",
        "properties": {
          "hasExactly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/content-pattern"
            }
          }
        },
        "required": [
          "hasExactly"
        ]
      },
      "includes-multivalue-pattern": {
        "title": "Has exactly multi value matcher",
        "type": "object",
        "properties": {
          "includes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/content-pattern"
            }
          }
        },
        "required": [
          "includes"
        ]
      },
      "request-pattern": {
        "type": "object",
        "example": "{\n  \"urlPath\" : \"/charges\",\n  \"method\" : \"POST\",\n  \"headers\" : {\n    \"Content-Type\" : {\n      \"equalTo\" : \"application/json\"\n    }\n  }\n",
        "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 : { \"\": \"\" } form. Can only\nbe used when the urlPathPattern URL match type is in use and all keys must be present as variables\nin the path template.\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "queryParameters": {
            "type": "object",
            "description": "Query parameter patterns to match against in the : { \"\": \"\" } form",
            "additionalProperties": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "formParameters": {
            "type": "object",
            "description": "application/x-www-form-urlencoded form parameter patterns to match against in the : { \"\": \"\" } form",
            "additionalProperties": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "headers": {
            "type": "object",
            "description": "Header patterns to match against in the : { \"\": \"\" } form",
            "additionalProperties": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "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 : { \"\": \"\" } form",
            "additionalProperties": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "bodyPatterns": {
            "type": "array",
            "description": "Request body patterns to match against in the : { \"\": \"\" } form",
            "items": {
              "$ref": "#/components/schemas/content-pattern"
            }
          },
          "customMatcher": {
            "type": "object",
            "description": "Custom request matcher to match against",
            "properties": {
              "name": {
                "type": "string",
                "description": "The matcher's name specified in the implementation of the matcher."
              },
              "parameters": {
                "type": "object"
              }
            }
          },
          "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 : { \"\": \"\" } form",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/content-pattern"
                  }
                },
                "bodyPatterns": {
                  "type": "array",
                  "description": "Body patterns to match against in the : { \"\": \"\" } form",
                  "items": {
                    "$ref": "#/components/schemas/content-pattern"
                  }
                }
              }
            }
          }
        }
      },
      "delay-distribution": {
        "type": "object",
        "description": "The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.",
        "oneOf": [
          {
            "title": "Log normal",
            "description": "Log normal randomly distributed response delay.",
            "type": "object",
            "properties": {
              "median": {
                "type": "integer"
              },
              "sigma": {
                "type": "number"
              },
              "type": {
                "type": "string",
                "enum": [
                  "lognormal"
                ]
              }
            },
            "required": [
              "median",
              "sigma"
            ]
          },
          {
            "title": "Uniform",
            "description": "Uniformly distributed random response delay.",
            "type": "object",
            "properties": {
              "lower": {
                "type": "integer"
              },
              "upper": {
                "type": "integer"
              },
              "type": {
                "type": "string",
                "enum": [
                  "uniform"
                ]
              }
            },
            "required": [
              "lower",
              "upper"
            ]
          },
          {
            "title": "Fixed",
            "description": "Fixed response delay.",
            "type": "object",
            "properties": {
              "milliseconds": {
                "type": "integer"
              },
              "type": {
                "type": "string",
                "enum": [
                  "fixed"
                ]
              }
            },
            "required": [
              "milliseconds"
            ]
          }
        ]
      },
      "response-definition": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer",
                "description": "The HTTP status code to be returned"
              },
              "statusMessage": {
                "type": "string",
                "description": "The HTTP status message to be returned"
              },
              "headers": {
                "type": "object",
                "description": "Map of response headers to send",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "additionalProxyRequestHeaders": {
                "type": "object",
                "description": "Extra request headers to send when proxying to another host.",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "removeProxyRequestHeaders": {
                "type": "array",
                "description": "Request headers to remove when proxying to another host.",
                "items": {
                  "type": "string"
                }
              },
              "body": {
                "type": "string",
                "description": "The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified."
              },
              "base64Body": {
                "$ref": "#/components/schemas/base64-string"
              },
              "jsonBody": {
                "description": "The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "type": "array"
                  }
                ]
              },
              "bodyFileName": {
                "type": "string",
                "description": "The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
                "example": "user-profile-responses/user1.json"
              },
              "fault": {
                "type": "string",
                "description": "The fault to apply (instead of a full, valid response).",
                "enum": [
                  "CONNECTION_RESET_BY_PEER",
                  "EMPTY_RESPONSE",
                  "MALFORMED_RESPONSE_CHUNK",
                  "RANDOM_DATA_THEN_CLOSE"
                ]
              },
              "fixedDelayMilliseconds": {
                "type": "integer",
                "description": "Number of milliseconds to delay be before sending the response."
              },
              "delayDistribution": {
                "$ref": "#/components/schemas/delay-distribution"
              },
              "chunkedDribbleDelay": {
                "type": "object",
                "description": "The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals",
                "properties": {
                  "numberOfChunks": {
                    "type": "integer"
                  },
                  "totalDuration": {
                    "type": "integer"
                  }
                },
                "required": [
                  "numberOfChunks",
                  "totalDuration"
                ]
              },
              "fromConfiguredStub": {
                "type": "boolean",
                "description": "Read-only flag indicating false if this was the default, unmatched response. Not present otherwise."
              },
              "proxyBaseUrl": {
                "type": "string",
                "description": "The base URL of the target to proxy matching requests to."
              },
              "proxyUrlPrefixToRemove": {
                "type": "string",
                "description": "A path segment to remove from the beginning in incoming request URL paths before proxying to the target."
              },
              "transformerParameters": {
                "type": "object",
                "description": "Parameters to apply to response transformers."
              },
              "transformers": {
                "type": "array",
                "description": "List of names of transformers to apply to this response.",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      "stub-mapping": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "This stub mapping's unique identifier"
          },
          "uuid": {
            "type": "string",
            "description": "Alias for the id"
          },
          "name": {
            "type": "string",
            "description": "The stub mapping's name"
          },
          "request": {
            "$ref": "#/components/schemas/request-pattern"
          },
          "response": {
            "$ref": "#/components/schemas/response-definition"
          },
          "persistent": {
            "type": "boolean",
            "description": "Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default."
          },
          "priority": {
            "type": "integer",
            "description": "This stub mapping's priority relative to others. 1 is highest.",
            "minimum": 1
          },
          "scenarioName": {
            "type": "string",
            "description": "The name of the scenario that this stub mapping is part of"
          },
          "requiredScenarioState": {
            "type": "string",
            "description": "The required state of the scenario in order for this stub to be matched."
          },
          "newScenarioState": {
            "type": "string",
            "description": "The new state for the scenario to be updated to after this stub is served."
          },
          "postServeActions": {
            "type": "object",
            "description": "A map of the names of post serve action extensions to trigger and their parameters."
          },
          "serveEventListeners": {
            "type": "array",
            "description": "The list of serve event listeners",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "requestPhases": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "BEFORE_MATCH",
                      "AFTER_MATCH",
                      "BEFORE_RESPONSE_SENT",
                      "AFTER_COMPLETE"
                    ]
                  }
                },
                "parameters": {
                  "type": "object"
                }
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs."
          }
        },
        "additionalProperties": false
      },
      "stub-mappings": {
        "type": "object",
        "properties": {
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/stub-mapping"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "example": 4
              }
            },
            "required": [
              "total"
            ]
          }
        },
        "additionalProperties": false
      },
      "bad-request-entity": {
        "title": "Bad request entity",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer"
                },
                "source": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "logged-request": {
        "type": "object",
        "properties": {
          "method": {
            "description": "The HTTP request method",
            "type": "string",
            "example": "GET"
          },
          "url": {
            "description": "The path and query to match exactly against",
            "type": "string",
            "example": "/received-request/2"
          },
          "absoluteUrl": {
            "description": "The full URL to match against",
            "type": "string",
            "example": "http://localhost:56738/received-request/2"
          },
          "headers": {
            "description": "Header patterns to match against in the : { \"\": \"\" } form",
            "type": "object",
            "example": {
              "Connection": "keep-alive",
              "Host": "localhost:56738",
              "User-Agent": "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
            }
          },
          "cookies": {
            "description": "Cookie patterns to match against in the : { \"\": \"\" } form",
            "type": "object",
            "example": {}
          },
          "body": {
            "description": "Body string to match against",
            "type": "string",
            "example": "Hello world"
          }
        }
      },
      "record-spec": {
        "type": "object",
        "properties": {
          "captureHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "caseInsensitive": {
                  "type": "boolean"
                }
              }
            },
            "description": "Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is \"caseInsensitive\", which defaults to false",
            "example": {
              "Accept": {},
              "Content-Type": {
                "caseInsensitive": true
              }
            }
          },
          "extractBodyCriteria": {
            "type": "object",
            "description": "Criteria for extracting response bodies to a separate file instead of including it in the stub mapping",
            "example": [
              {
                "binarySizeThreshold": "1 Mb",
                "textSizeThreshold": "2 kb"
              }
            ],
            "properties": {
              "binarySizeThreshold": {
                "type": "string",
                "default": "0",
                "description": "Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \"56 Mb\". Default unit is bytes.",
                "example": "18.2 GB"
              },
              "textSizeThreshold": {
                "default": "0",
                "description": "Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \"56 Mb\". Default unit is bytes.",
                "example": "18.2 GB",
                "type": "string"
              }
            }
          },
          "persist": {
            "type": "boolean",
            "default": true,
            "description": "Whether to save stub mappings to the file system or just return them"
          },
          "repeatsAsScenarios": {
            "type": "boolean",
            "default": true,
            "description": "When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded"
          },
          "requestBodyPattern": {
            "type": "object",
            "description": "Control the request body matcher used in generated stub mappings",
            "oneOf": [
              {
                "type": "object",
                "description": "Automatically determine matcher based on content type (the default)",
                "properties": {
                  "caseInsensitive": {
                    "type": "boolean",
                    "default": false,
                    "description": "If equalTo is used, match body use case-insensitive string comparison"
                  },
                  "ignoreArrayOrder": {
                    "type": "boolean",
                    "default": true,
                    "description": "If equalToJson is used, ignore order of array elements"
                  },
                  "ignoreExtraElements": {
                    "type": "boolean",
                    "default": true,
                    "description": "If equalToJson is used, matcher ignores extra elements in objects"
                  },
                  "matcher": {
                    "type": "string",
                    "enum": [
                      "auto"
                    ]
                  }
                }
              },
              {
                "type": "object",
                "description": "Always match request bodies using equalTo",
                "properties": {
                  "caseInsensitive": {
                    "default": false,
                    "description": "Match body using case-insensitive string comparison",
                    "type": "boolean"
                  },
                  "matcher": {
                    "enum": [
                      "equalTo"
                    ],
                    "type": "string"
                  }
                }
              },
              {
                "type": "object",
                "description": "Always match request bodies using equalToJson",
                "properties": {
                  "ignoreArrayOrder": {
                    "default": true,
                    "description": "Ignore order of array elements",
                    "type": "boolean"
                  },
                  "ignoreExtraElements": {
                    "default": true,
                    "description": "Ignore extra elements in objects",
                    "type": "boolean"
                  },
                  "matcher": {
                    "enum": [
                      "equalToJson"
                    ],
                    "type": "string"
                  }
                }
              },
              {
                "type": "object",
                "description": "Always match request bodies using equalToXml",
                "properties": {
                  "matcher": {
                    "type": "string",
                    "enum": [
                      "equalToXml"
                    ]
                  }
                }
              }
            ]
          },
          "transformerParameters": {
            "type": "object",
            "description": "List of names of stub mappings transformers to apply to generated stubs"
          },
          "transformers": {
            "type": "array",
            "description": "Parameters to pass to stub mapping transformers",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "scenario": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The scenario ID",
            "example": "c8d249ec-d86d-48b1-88a8-a660e6848042"
          },
          "name": {
            "type": "string",
            "description": "The scenario name",
            "example": "my_scenario"
          },
          "possibleStates": {
            "type": "array",
            "items": {
              "default": "Started",
              "description": "All the states this scenario can be in",
              "type": "string"
            },
            "example": [
              "Started",
              "state_1",
              "state_2"
            ]
          },
          "state": {
            "type": "string",
            "default": "Started",
            "description": "The current state of this scenario",
            "example": "state_2"
          }
        }
      },
      "health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "healthy",
            "description": "The status of the server",
            "enum": [
              "healthy",
              "unhealthy"
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer message regarding the status of the server",
            "example": "Wiremock is ok"
          },
          "version": {
            "type": "string",
            "description": "The WireMock version",
            "example": "3.8.0"
          },
          "uptimeInSeconds": {
            "type": "integer",
            "description": "How long the server has been running",
            "example": 14355
          },
          "timestamp": {
            "type": "string",
            "description": "The current timestamp",
            "example": "2024-07-03T13:16:06.172362Z"
          }
        }
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy