swagger.wiremock-admin-api.json Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wiremock-standalone Show documentation
Show all versions of wiremock-standalone Show documentation
A web service test double for all occasions
{
"consumes": [
"application/json"
],
"definitions": {
"recordSpec": {
"properties": {
"captureHeaders": {
"type": "object"
},
"extractBodyCriteria": {
"properties": {
"binarySizeThreshold": {
"type": "string"
},
"textSizeThreshold": {
"type": "string"
}
},
"type": "object"
},
"filters": {
"properties": {
"ids": {
"items": {
"type": "string"
},
"type": "array"
},
"method": {
"type": "string"
},
"urlPathPattern": {
"type": "string"
}
},
"type": "object"
},
"persist": {
"type": "boolean"
},
"repeatsAsScenarios": {
"type": "boolean"
},
"requestBodyPattern": {
"properties": {
"caseInsensitive": {
"type": "boolean"
},
"ignoreArrayOrder": {
"type": "boolean"
},
"ignoreExtraElements": {
"type": "boolean"
},
"matcher": {
"enum": [
"equalTo",
"equalToJson",
"equalToXml",
"auto"
],
"type": "string"
}
},
"type": "object"
},
"targetBaseUrl": {
"type": "string"
},
"transformerParameters": {
"properties": {
"headerValue": {
"type": "string"
}
},
"type": "object"
},
"transformers": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"requestPattern": {
"example": {
"bodyPatterns": [
{
"equalToJson": "{ \"numbers\": [1, 2, 3] }"
}
],
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"url": "/some/thing"
},
"properties": {
"basicAuthCredentials": {
"description": "Pre-emptive basic auth credentials to match against",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
},
"required": [
"username",
"password"
],
"type": "object"
},
"bodyPatterns": {
"description": "Request body patterns to match against in the : { \"\": \"\" } form",
"items": {
"type": "object"
},
"type": "array"
},
"cookies": {
"description": "Cookie patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"headers": {
"description": "Header patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"method": {
"description": "The HTTP request method e.g. GET",
"type": "string"
},
"queryParameters": {
"description": "Query parameter patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"url": {
"description": "The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPath": {
"description": "The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPathPattern": {
"description": "The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPattern": {
"description": "The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
}
},
"type": "object"
},
"scenarios": {
"properties": {
"scenarios": {
"items": {
"properties": {
"id": {
"description": "The scenario ID",
"examples": [
"c8d249ec-d86d-48b1-88a8-a660e6848042"
],
"id": "/properties/id",
"type": "string"
},
"name": {
"description": "The scenario name",
"examples": [
"my_scenario"
],
"id": "/properties/name",
"type": "string"
},
"possibleStates": {
"id": "/properties/possibleStates",
"items": {
"default": "Started",
"description": "All the states this scenario can be in",
"examples": [
"Started",
"Step two",
"step_3"
],
"id": "/properties/possibleStates/items",
"type": "string"
},
"type": "array"
},
"state": {
"default": "Started",
"description": "The current state of this scenario",
"examples": [
"Started",
"Step two",
"step_3"
],
"id": "/properties/state",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"stubMapping": {
"example": {
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"priority": 3,
"request": {
"headers": {
"Accept": "text/plain"
},
"method": "GET",
"url": "/some/thing"
},
"response": {
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
},
"status": 200
}
},
"properties": {
"id": {
"description": "This stub mapping's unique identifier",
"type": "string"
},
"newScenarioState": {
"descrption": "The new state for the scenario to be updated to after this stub is served.",
"type": "string"
},
"persistent": {
"description": "Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.",
"type": "boolean"
},
"postServeActions": {
"descrption": "A map of the names of post serve action extensions to trigger and their parameters.",
"type": "object"
},
"priority": {
"description": "This stub mapping's priority relative to others. 1 is highest.",
"minimum": 1,
"type": "integer"
},
"request": {
"example": {
"bodyPatterns": [
{
"equalToJson": "{ \"numbers\": [1, 2, 3] }"
}
],
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"url": "/some/thing"
},
"properties": {
"basicAuthCredentials": {
"description": "Pre-emptive basic auth credentials to match against",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
},
"required": [
"username",
"password"
],
"type": "object"
},
"bodyPatterns": {
"description": "Request body patterns to match against in the : { \"\": \"\" } form",
"items": {
"type": "object"
},
"type": "array"
},
"cookies": {
"description": "Cookie patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"headers": {
"description": "Header patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"method": {
"description": "The HTTP request method e.g. GET",
"type": "string"
},
"queryParameters": {
"description": "Query parameter patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"url": {
"description": "The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPath": {
"description": "The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPathPattern": {
"description": "The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPattern": {
"description": "The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
}
},
"type": "object"
},
"requiredScenarioState": {
"descrption": "The required state of the scenario in order for this stub to be matched.",
"type": "string"
},
"response": {
"definitions": {
"logNormalDistribution": {
"descrioption": "Log normal randomly distributed response delay.",
"properties": {
"median": {
"type": "integer"
},
"sigma": {
"type": "number"
},
"type": {
"enum": [
"lognormal"
],
"type": "string"
}
},
"required": [
"type",
"median",
"sigma"
],
"type": "object"
},
"uniformDistribution": {
"descrioption": "Uniformly distributed random response delay.",
"properties": {
"lower": {
"type": "integer"
},
"type": {
"enum": [
"uniform"
],
"type": "string"
},
"upper": {
"type": "integer"
}
},
"required": [
"type",
"upper",
"lower"
],
"type": "object"
}
},
"properties": {
"additionalProxyRequestHeaders": {
"description": "Extra request headers to send when proxying to another host.",
"type": "object"
},
"base64Body": {
"description": "The response body as a base64 encoded string (useful for binary content). Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "string"
},
"body": {
"description": "The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "string"
},
"bodyFileName": {
"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.",
"type": "string"
},
"delayDistribution": {
"description": "Random delay settings.",
"oneOf": [
{
"$ref": "#/definitions/#/properties/response/definitions/logNormalDistribution"
},
{
"$ref": "#/definitions/#/properties/response/definitions/uniformDistribution"
}
]
},
"fault": {
"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"
],
"type": "string"
},
"fixedDelayMilliseconds": {
"description": "Number of milliseconds to delay be before sending the response.",
"type": "integer"
},
"fromConfiguredStub": {
"description": "Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.",
"type": "boolean"
},
"headers": {
"description": "Map of response headers to send",
"type": "object"
},
"jsonBody": {
"description": "The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "object"
},
"proxyBaseUrl": {
"description": "The base URL of the target to proxy matching requests to.",
"type": "string"
},
"status": {
"description": "The HTTP status code to be returned",
"type": "integer"
},
"statusMessage": {
"description": "The HTTP status message to be returned",
"type": "string"
},
"transformerParameters": {
"description": "Parameters to apply to response transformers.",
"type": "object"
},
"transformers": {
"description": "List of names of transformers to apply to this response.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"scenarioName": {
"descrption": "The name of the scenario that this stub mapping is part of",
"type": "string"
}
},
"type": "object"
},
"stubMappings": {
"properties": {
"mappings": {
"example": {
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"priority": 3,
"request": {
"headers": {
"Accept": "text/plain"
},
"method": "GET",
"url": "/some/thing"
},
"response": {
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
},
"status": 200
}
},
"properties": {
"id": {
"description": "This stub mapping's unique identifier",
"type": "string"
},
"newScenarioState": {
"descrption": "The new state for the scenario to be updated to after this stub is served.",
"type": "string"
},
"persistent": {
"description": "Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.",
"type": "boolean"
},
"postServeActions": {
"descrption": "A map of the names of post serve action extensions to trigger and their parameters.",
"type": "object"
},
"priority": {
"description": "This stub mapping's priority relative to others. 1 is highest.",
"minimum": 1,
"type": "integer"
},
"request": {
"example": {
"bodyPatterns": [
{
"equalToJson": "{ \"numbers\": [1, 2, 3] }"
}
],
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"url": "/some/thing"
},
"properties": {
"basicAuthCredentials": {
"description": "Pre-emptive basic auth credentials to match against",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
},
"required": [
"username",
"password"
],
"type": "object"
},
"bodyPatterns": {
"description": "Request body patterns to match against in the : { \"\": \"\" } form",
"items": {
"type": "object"
},
"type": "array"
},
"cookies": {
"description": "Cookie patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"headers": {
"description": "Header patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"method": {
"description": "The HTTP request method e.g. GET",
"type": "string"
},
"queryParameters": {
"description": "Query parameter patterns to match against in the : { \"\": \"\" } form",
"type": "object"
},
"url": {
"description": "The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPath": {
"description": "The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPathPattern": {
"description": "The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
},
"urlPattern": {
"description": "The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.",
"type": "string"
}
},
"type": "object"
},
"requiredScenarioState": {
"descrption": "The required state of the scenario in order for this stub to be matched.",
"type": "string"
},
"response": {
"definitions": {
"logNormalDistribution": {
"descrioption": "Log normal randomly distributed response delay.",
"properties": {
"median": {
"type": "integer"
},
"sigma": {
"type": "number"
},
"type": {
"enum": [
"lognormal"
],
"type": "string"
}
},
"required": [
"type",
"median",
"sigma"
],
"type": "object"
},
"uniformDistribution": {
"descrioption": "Uniformly distributed random response delay.",
"properties": {
"lower": {
"type": "integer"
},
"type": {
"enum": [
"uniform"
],
"type": "string"
},
"upper": {
"type": "integer"
}
},
"required": [
"type",
"upper",
"lower"
],
"type": "object"
}
},
"properties": {
"additionalProxyRequestHeaders": {
"description": "Extra request headers to send when proxying to another host.",
"type": "object"
},
"base64Body": {
"description": "The response body as a base64 encoded string (useful for binary content). Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "string"
},
"body": {
"description": "The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "string"
},
"bodyFileName": {
"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.",
"type": "string"
},
"delayDistribution": {
"description": "Random delay settings.",
"oneOf": [
{
"$ref": "#/definitions/#/properties/mappings/properties/response/definitions/logNormalDistribution"
},
{
"$ref": "#/definitions/#/properties/mappings/properties/response/definitions/uniformDistribution"
}
]
},
"fault": {
"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"
],
"type": "string"
},
"fixedDelayMilliseconds": {
"description": "Number of milliseconds to delay be before sending the response.",
"type": "integer"
},
"fromConfiguredStub": {
"description": "Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.",
"type": "boolean"
},
"headers": {
"description": "Map of response headers to send",
"type": "object"
},
"jsonBody": {
"description": "The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.",
"type": "object"
},
"proxyBaseUrl": {
"description": "The base URL of the target to proxy matching requests to.",
"type": "string"
},
"status": {
"description": "The HTTP status code to be returned",
"type": "integer"
},
"statusMessage": {
"description": "The HTTP status message to be returned",
"type": "string"
},
"transformerParameters": {
"description": "Parameters to apply to response transformers.",
"type": "object"
},
"transformers": {
"description": "List of names of transformers to apply to this response.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"scenarioName": {
"descrption": "The name of the scenario that this stub mapping is part of",
"type": "string"
}
},
"type": "object"
},
"meta": {
"properties": {
"total": {
"type": "integer"
}
},
"required": [
"total"
],
"type": "object"
}
},
"type": "object"
}
},
"info": {
"title": "WireMock",
"version": "2.10.0"
},
"paths": {
"/__admin/mappings": {
"delete": {
"description": "Delete all stub mappings",
"responses": {
"200": {
"description": "Successfully deleted"
}
}
},
"get": {
"description": "Get all stub mappings",
"parameters": [
{
"description": "The maximum number of results to return",
"in": "query",
"name": "limit",
"required": false,
"type": "number"
},
{
"description": "The start index of the results to return",
"in": "query",
"name": "offset",
"required": false,
"type": "number"
}
],
"responses": {
"200": {
"description": "All stub mappings",
"schema": {
"$ref": "#/definitions/stubMappings"
}
}
}
},
"post": {
"description": "Create a new stub mapping",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/stubMapping"
}
}
],
"responses": {
"201": {
"description": "Successfully created",
"schema": {
"$ref": "#/definitions/stubMapping"
}
}
}
}
},
"/__admin/mappings/reset": {
"post": {
"description": "Reset stub mappings (restore to defaults defined back the backing store)",
"responses": {
"200": {
"description": "Successfully reset"
}
}
}
},
"/__admin/mappings/save": {
"post": {
"description": "Save all persistent stub mappings to the backing store",
"responses": {
"200": {
"description": "Successfully removed"
}
}
}
},
"/__admin/mappings/{stubMappingId}": {
"delete": {
"description": "Delete a stub mapping",
"parameters": [
{
"description": "The UUID of stub mapping",
"in": "path",
"name": "stubMappingId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"get": {
"description": "Get a single stub mapping",
"parameters": [
{
"description": "The UUID of stub mapping",
"in": "path",
"name": "stubMappingId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/stubMapping"
}
}
}
},
"put": {
"description": "Update an existing stub mapping",
"parameters": [
{
"description": "The UUID of stub mapping",
"in": "path",
"name": "stubMappingId",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/stubMapping"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/stubMapping"
}
}
}
}
},
"/__admin/near-misses/request": {
"post": {
"description": "Find at most 3 near misses for closest stub mappings to the specified request",
"parameters": [
{
"in": "body",
"name": "body",
"required": true
}
],
"responses": {
"200": {
"description": "Near misses matching criteria"
}
}
}
},
"/__admin/near-misses/request-pattern": {
"post": {
"description": "Find at most 3 near misses for closest logged requests to the specified request pattern",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requestPattern"
}
}
],
"responses": {
"200": {
"description": "Near misses matching criteria"
}
}
}
},
"/__admin/recordings/snapshot": {
"post": {
"description": "Take a snapshot recording",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/recordSpec"
}
}
],
"responses": {
"200": {
"description": "Successfully took a snapshot recording",
"schema": {
"$ref": "#/definitions/stubMappings"
}
}
}
}
},
"/__admin/recordings/start": {
"post": {
"description": "Start recording stub mappings",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/recordSpec"
}
}
],
"responses": {
"200": {
"description": "Successfully started recording"
}
}
}
},
"/__admin/recordings/status": {
"get": {
"description": "Get the recording status (started or stopped)",
"responses": {
"200": {
"description": "Successfully got the record status"
}
}
}
},
"/__admin/recordings/stop": {
"post": {
"description": "Stop recording stub mappings",
"responses": {
"200": {
"description": "Successfully started recording",
"schema": {
"$ref": "#/definitions/stubMappings"
}
}
}
}
},
"/__admin/requests": {
"delete": {
"description": "Delete all received requests",
"responses": {
"200": {
"description": "Successfully deleted"
}
}
},
"get": {
"description": "Get received requests",
"parameters": [
{
"description": "The maximum number of results to return",
"in": "query",
"name": "limit",
"type": "string"
},
{
"description": "Only return logged requests after this date",
"in": "query",
"name": "since",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/__admin/requests/count": {
"post": {
"description": "Count requests logged in the journal matching the specified criteria",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requestPattern"
}
}
],
"responses": {
"200": {
"description": "Number of matching requests"
}
}
}
},
"/__admin/requests/find": {
"post": {
"description": "Retrieve details of requests logged in the journal matching the specified criteria",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requestPattern"
}
}
],
"responses": {
"200": {
"description": "Matching request details"
}
}
}
},
"/__admin/requests/reset": {
"post": {
"description": "Empty the request journal",
"responses": {
"200": {
"description": "Successfully reset"
}
}
}
},
"/__admin/requests/unmatched": {
"get": {
"description": "Get details of logged requests that weren't matched by any stub mapping",
"responses": {
"200": {
"description": "Unmatched request details"
}
}
}
},
"/__admin/requests/unmatched/near-misses": {
"get": {
"description": "Retrieve near-misses for all unmatched requests",
"responses": {
"200": {
"description": "Top 3 (at most) near misses for each unmatched request"
}
}
}
},
"/__admin/requests/{requestId}": {
"get": {
"parameters": [
{
"description": "The UUID of the logged request",
"in": "path",
"name": "requestId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/__admin/scenarios": {
"get": {
"description": "Get all scenarios",
"responses": {
"200": {
"description": "All scenarios",
"schema": {
"$ref": "#/definitions/scenarios"
}
}
}
}
},
"/__admin/scenarios/reset": {
"post": {
"description": "Reset the state of all scenarios",
"responses": {
"200": {
"description": "Successfully reset"
}
}
}
},
"/__admin/settings": {
"post": {
"description": "Update global settings",
"parameters": [
{
"in": "body",
"name": "body",
"required": true
}
],
"responses": {
"200": {
"description": "Settings successfully updated"
}
}
}
},
"/__admin/shutdown": {
"post": {
"description": "Shutdown the WireMock server",
"responses": {
"200": {
"description": "Server will be shut down"
}
}
}
}
},
"produces": [
"application/json"
],
"securityDefinitions": {},
"swagger": "2.0"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy