Type object
File match wiremock-message-stub-mapping.yml wiremock-message-stub-mapping.yaml message-stubs.json message-stub-mappings.json message-stubs.yaml message-stub-mappings.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/wiremock-message-stub-mapping/latest.json
Source https://raw.githubusercontent.com/wiremock/wiremock/refs/heads/master/schemas/wiremock-message-stub-mapping-or-mappings.json

Validate with Lintel

npx @lintel/lintel check
Type: object

One of

Definitions

absent-pattern object
absent boolean required
after-pattern object
after string required
actualFormat string
truncateExpected string
Values: "first second of minute" "first minute of hour" "first hour of day" "first day of month" "first day of next month" "last day of month" "first day of year" "first day of next year" "last day of year"
truncateActual string
Values: "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"
and-pattern object
and content-pattern[] required
bad-request-entity object
errors object[]
base64-string string

A base64 encoded string used to describe binary data.

before-pattern object
before string required
actualFormat string
truncateExpected string
Values: "first second of minute" "first minute of hour" "first hour of day" "first day of month" "first day of next month" "last day of month" "first day of year" "first day of next year" "last day of year"
truncateActual string
Values: "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"
binary-equal-to-pattern object
binaryEqualTo string required

A base64 encoded string used to describe binary data.

pattern=^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
channel-pattern object

Pattern for matching message channels

type string required

The type of message channel

Values: "websocket"
initiatingRequestPattern object
19 nested properties
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

2 nested properties
password string required
username string required
cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

2 nested properties
name string

The matcher's name specified in the implementation of the matcher.

parameters object
multipartPatterns object[]

Multipart patterns to match against headers and body.

channel-target object | object
channel-type string

The type of message channel

contains-pattern object
contains string required
content-pattern object
dateTimeExpression string
format string
truncation string
delay-distribution object

The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.

does-not-contain-pattern object
doesNotContain string required
does-not-match-pattern object
doesNotMatch string required
equal-to-date-time-pattern object
equalToDateTime string required
actualFormat string
truncateExpected string
Values: "first second of minute" "first minute of hour" "first hour of day" "first day of month" "first day of next month" "last day of month" "first day of year" "first day of next year" "last day of year"
truncateActual string
Values: "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"
equal-to-json-pattern object
equalToJson object | string required
ignoreExtraElements boolean
ignoreArrayOrder boolean
equal-to-number-pattern object
equalToNumber number required
equal-to-pattern object
equalTo string required
caseInsensitive boolean
equal-to-xml-pattern object
equalToXml string required
enablePlaceholders boolean
placeholderOpeningDelimiterRegex string
placeholderClosingDelimiterRegex string
namespaceAwareness string
Values: "LEGACY" "STRICT" "NONE"
greater-than-equal-number-pattern object
greaterThanEqualNumber number required
greater-than-number-pattern object
greaterThanNumber number required
has-exactly-multivalue-pattern object
hasExactly content-pattern[] required
headers Record<string, object>

HTTP headers

health object
status string

The status of the server

Values: "healthy" "unhealthy"
message string

Longer message regarding the status of the server

version string

The WireMock version

uptimeInSeconds integer

How long the server has been running

timestamp string

The current timestamp

includes-multivalue-pattern object
includes content-pattern[] required
less-than-equal-number-pattern object
lessThanEqualNumber number required
less-than-number-pattern object
lessThanNumber number required
logged-message-channel object

A logged message channel

id string

Unique identifier for this channel

format=uuid
type string

The type of message channel

Values: "websocket"
initiatingRequest object
19 nested properties
id string

The unique identifier for this request

format=uuid
method string

The HTTP request method

url string

The path and query to match exactly against

absoluteUrl string

The full URL to match against

scheme string

The URL scheme (http/https)

host string

The host part of the URL

port integer

The port number

clientIp string

The client IP address

headers Record<string, object>

HTTP headers

cookies Record<string, object>

Cookies received with the request

body string

Body string to match against

bodyAsBase64 string

Base64 encoded body content

browserProxyRequest boolean

Whether this request was made via a browser proxy

loggedDate integer

The timestamp when the request was logged (epoch millis)

format=int64
loggedDateString string

The formatted date string when the request was logged

queryParams Record<string, object>

Query parameters parsed from the URL

formParams Record<string, object>

Form parameters parsed from the request body

multiparts object[]

Multipart form data parts

protocol string

The HTTP protocol version

open boolean

Whether the channel is currently open

logged-request object
id string

The unique identifier for this request

format=uuid
method string

The HTTP request method

url string

The path and query to match exactly against

absoluteUrl string

The full URL to match against

scheme string

The URL scheme (http/https)

host string

The host part of the URL

port integer

The port number

clientIp string

The client IP address

headers Record<string, object>

HTTP headers

cookies Record<string, object>

Cookies received with the request

body string

Body string to match against

bodyAsBase64 string

Base64 encoded body content

browserProxyRequest boolean

Whether this request was made via a browser proxy

loggedDate integer

The timestamp when the request was logged (epoch millis)

format=int64
loggedDateString string

The formatted date string when the request was logged

queryParams Record<string, object>

Query parameters parsed from the URL

formParams Record<string, object>

Form parameters parsed from the request body

multiparts object[]

Multipart form data parts

protocol string

The HTTP protocol version

matches-json-path-pattern object
matchesJsonPath string | object required
matches-json-schema-pattern object
matchesJsonSchema string required

A valid JSON schema as a string

schemaVersion enum

The JSON schema version to interpret the schema against

Values: "V4" "V6" "V7" "V201909" "V202012"
matches-pattern object
matches string required
matches-xpath-pattern object
matchesXPath string | object required
xPathNamespaces Record<string, string>
message-action object

Action to perform when a message stub is triggered

type string required
Values: "send"
message object required

Definition of a message to be sent

1 nested properties
body object | object

The message body

channelTarget object | object
transformers string[]

List of transformer names to apply to the message

transformerParameters object

Parameters to pass to transformers

message-channels-result object

Result containing message channels

meta object

Pagination metadata

1 nested properties
total integer

Total number of channels

message-definition object

Definition of a message to be sent

body object | object

The message body

message-pattern object

Pattern for matching messages

channel object
19 nested properties
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

2 nested properties
password string required
username string required
cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

2 nested properties
name string

The matcher's name specified in the implementation of the matcher.

parameters object
multipartPatterns object[]

Multipart patterns to match against headers and body.

message-serve-event object

A message event logged in the journal

id string

Unique identifier for this message event

format=uuid
eventType string

Whether the message was received or sent

Values: "RECEIVED" "SENT"
channelType string

The type of message channel

Values: "websocket"
channelId string

ID of the channel on which the message was sent/received

format=uuid
channelRequest object
19 nested properties
id string

The unique identifier for this request

format=uuid
method string

The HTTP request method

url string

The path and query to match exactly against

absoluteUrl string

The full URL to match against

scheme string

The URL scheme (http/https)

host string

The host part of the URL

port integer

The port number

clientIp string

The client IP address

headers Record<string, object>

HTTP headers

cookies Record<string, object>

Cookies received with the request

body string

Body string to match against

bodyAsBase64 string

Base64 encoded body content

browserProxyRequest boolean

Whether this request was made via a browser proxy

loggedDate integer

The timestamp when the request was logged (epoch millis)

format=int64
loggedDateString string

The formatted date string when the request was logged

queryParams Record<string, object>

Query parameters parsed from the URL

formParams Record<string, object>

Form parameters parsed from the request body

multiparts object[]

Multipart form data parts

protocol string

The HTTP protocol version

message string

The message body as a string

stubMapping object

A message stub mapping defines how WireMock responds to messages on channels

7 nested properties
id string

This message stub mapping's unique identifier

format=uuid
uuid string

Alias for the id

format=uuid
name string

The message stub mapping's name

priority integer

This message stub mapping's priority relative to others. 1 is highest.

min=1
trigger object | object | object

Actions to perform when this stub is triggered

metadata object

Arbitrary metadata to be attached to the stub mapping

wasMatched boolean

Whether this message matched a stub mapping

timestamp string

When the message event occurred

format=date-time
subEvents object[]

Sub-events that occurred during message processing

message-serve-events-result object

Result containing message serve events

messageServeEvents message-serve-event[]
messageJournalDisabled boolean

Whether the message journal is disabled

message-stub-mapping object

A message stub mapping defines how WireMock responds to messages on channels

id string

This message stub mapping's unique identifier

format=uuid
uuid string

Alias for the id

format=uuid
name string

The message stub mapping's name

priority integer

This message stub mapping's priority relative to others. 1 is highest.

min=1
trigger object | object | object

Actions to perform when this stub is triggered

metadata object

Arbitrary metadata to be attached to the stub mapping

message-stub-mappings object

A collection of message stub mappings

messageMappings message-stub-mapping[]
meta object

Pagination metadata

1 nested properties
total integer

Total number of message stub mappings

message-trigger object | object | object
message-verification-result object

Result of a message verification operation

count integer

Number of messages matching the criteria

messageJournalDisabled boolean

Whether the message journal is disabled

none-of-request-method-pattern object
noneOf string[] required
one-of-request-method-pattern object
oneOf string[] required
or-pattern object
or content-pattern[] required
record-spec object
captureHeaders Record<string, object>

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

extractBodyCriteria object

Criteria for extracting response bodies to a separate file instead of including it in the stub mapping

2 nested properties
binarySizeThreshold string

Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.

Default: "0"
textSizeThreshold string

Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.

Default: "0"
persist boolean

Whether to save stub mappings to the file system or just return them

Default: true
repeatsAsScenarios boolean

When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded

Default: true
requestBodyPattern object

Control the request body matcher used in generated stub mappings

One of: object object, object object, object object, object object
transformerParameters object

List of names of stub mappings transformers to apply to generated stubs

transformers string[]

Parameters to pass to stub mapping transformers

request-method-pattern object
request-pattern object
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

2 nested properties
password string required
username string required
cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

2 nested properties
name string

The matcher's name specified in the implementation of the matcher.

parameters object
multipartPatterns object[]

Multipart patterns to match against headers and body.

response-definition
scenario object
id string

The scenario ID

name string

The scenario name

possibleStates string[]
state string

The current state of this scenario

Default: "Started"
send-channel-message-request object

Request to send a message to channels

type string required

The type of message channel

Values: "websocket"
message object required

Definition of a message to be sent

1 nested properties
body object | object

The message body

initiatingRequest object
19 nested properties
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

2 nested properties
password string required
username string required
cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

2 nested properties
name string

The matcher's name specified in the implementation of the matcher.

parameters object
multipartPatterns object[]

Multipart patterns to match against headers and body.

send-channel-message-result object

Result of sending a message to channels

Channels that received the message

channelsMessaged integer

Number of channels that received the message

single-message-serve-event-result object

Result containing a single message serve event

item object

A message event logged in the journal

10 nested properties
id string

Unique identifier for this message event

format=uuid
eventType string

Whether the message was received or sent

Values: "RECEIVED" "SENT"
channelType string

The type of message channel

Values: "websocket"
channelId string

ID of the channel on which the message was sent/received

format=uuid
channelRequest object
19 nested properties
id string

The unique identifier for this request

format=uuid
method string

The HTTP request method

url string

The path and query to match exactly against

absoluteUrl string

The full URL to match against

scheme string

The URL scheme (http/https)

host string

The host part of the URL

port integer

The port number

clientIp string

The client IP address

headers Record<string, object>

HTTP headers

cookies Record<string, object>

Cookies received with the request

body string

Body string to match against

bodyAsBase64 string

Base64 encoded body content

browserProxyRequest boolean

Whether this request was made via a browser proxy

loggedDate integer

The timestamp when the request was logged (epoch millis)

format=int64
loggedDateString string

The formatted date string when the request was logged

queryParams Record<string, object>

Query parameters parsed from the URL

formParams Record<string, object>

Form parameters parsed from the request body

multiparts object[]

Multipart form data parts

protocol string

The HTTP protocol version

message string

The message body as a string

stubMapping object

A message stub mapping defines how WireMock responds to messages on channels

7 nested properties
id string

This message stub mapping's unique identifier

format=uuid
uuid string

Alias for the id

format=uuid
name string

The message stub mapping's name

priority integer

This message stub mapping's priority relative to others. 1 is highest.

min=1
trigger object | object | object

Actions to perform when this stub is triggered

metadata object

Arbitrary metadata to be attached to the stub mapping

wasMatched boolean

Whether this message matched a stub mapping

timestamp string

When the message event occurred

format=date-time
subEvents object[]

Sub-events that occurred during message processing

stub-mapping object
id string

This stub mapping's unique identifier

uuid string

Alias for the id

name string

The stub mapping's name

request object
19 nested properties
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

2 nested properties
password string required
username string required
cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

2 nested properties
name string

The matcher's name specified in the implementation of the matcher.

parameters object
multipartPatterns object[]

Multipart patterns to match against headers and body.

response
All of: object object
persistent boolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

priority integer

This stub mapping's priority relative to others. 1 is highest.

min=1
scenarioName string

The name of the scenario that this stub mapping is part of

requiredScenarioState string

The required state of the scenario in order for this stub to be matched.

newScenarioState string

The new state for the scenario to be updated to after this stub is served.

postServeActions object[]

DEPRECATED: Use serveEventListeners instead. A map of the names of post serve action extensions to trigger and their parameters.

serveEventListeners object[]

The list of serve event listeners

metadata object

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

stub-mappings object
mappings stub-mapping[]
meta object
1 nested properties
total integer required
wait-for-message-request object

Request to wait for message events

timeoutMillis integer required

Maximum time to wait in milliseconds

format=int64
pattern object

Pattern for matching messages

2 nested properties
channel object
19 nested properties
scheme string

The scheme (protocol) part of the request URL

Values: "http" "https"
host string

The hostname part of the request URL

port integer

The HTTP port number of the request URL

min=1max=65535
url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathTemplate string

The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.

queryParameters Record<string, object>

Query parameter patterns to match against in the : { "": "" } form

formParameters Record<string, object>

application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form

headers Record<string, object>

Header patterns to match against in the : { "": "" } form

clientIp string

The client IP address to match against

basicAuthCredentials object

Pre-emptive basic auth credentials to match against

cookies Record<string, object>

Cookie patterns to match against in the : { "": "" } form

bodyPatterns content-pattern[]

Request body patterns to match against in the { "": "" } form

customMatcher object

Custom request matcher to match against

multipartPatterns object[]

Multipart patterns to match against headers and body.

count integer

Number of messages to wait for (for wait-for-count endpoint)