Type object
File match wiremock-import-config.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/wiremock-cli-import-configuration/latest.json
Source https://static.wiremock.io/schemas/wiremock-import-config.yaml-schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Configures how stubs should be generated when importing or recording

Properties

import object required
1 nested properties
stubTemplateTransformationRules object[]

A set of rules for transforming stub templates. All matching rules will be applied to the template. If multiple rules define matchers with the same name, the last rule will win.

Definitions

equal-to-pattern object
equalTo string required
caseInsensitive boolean
base64-string string

A base64 encoded string used to describe binary data.

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}=)?$
contains-pattern object
contains string required
does-not-contain-pattern object
doesNotContain string required
matches-pattern object
matches string required
does-not-match-pattern object
doesNotMatch string required
content-pattern object
dateTimeExpression string
format string
truncation string
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"
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"
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 string required
ignoreExtraElements boolean
ignoreArrayOrder boolean
matches-json-path-pattern object
matchesJsonPath string | object required
equal-to-xml-pattern object
equalToXml string required
enablePlaceholders boolean
placeholderOpeningDelimiterRegex string
placeholderClosingDelimiterRegex string
matches-xpath-pattern object
matchesXPath string | object required
xPathNamespaces Record<string, string>
matches-json-schema-pattern object
matchesJsonSchema string | object required
xPathNamespaces Record<string, string>
absent-pattern object
absent boolean required
and-pattern object
and content-pattern[] required
or-pattern object
or content-pattern[] required
has-exactly-multivalue-pattern object
hasExactly content-pattern[] required
includes-multivalue-pattern object
includes content-pattern[] required
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
method string

The HTTP request method e.g. GET

pattern=^[A-Z]+$
url string

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

urlPath string

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

urlPathPattern string

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

urlPattern string

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

urlPathTemplate string

A Level 1 URI Template as specified in https://datatracker.ietf.org/doc/html/rfc6570. Only one of url, urlPattern, urlPath, urlPathPattern or urlPathTemplate may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathTemplate 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

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.

delay-distribution object

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

response-definition
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
18 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
method string

The HTTP request method e.g. GET

pattern=^[A-Z]+$
url string

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

urlPath string

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

urlPathPattern string

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

urlPattern string

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

urlPathTemplate string

A Level 1 URI Template as specified in https://datatracker.ietf.org/doc/html/rfc6570. Only one of url, urlPattern, urlPath, urlPathPattern or urlPathTemplate may be specified.

pathParameters Record<string, object>

Path parameter patterns to match against in the : { "": "" } form. Can only be used when the urlPathTemplate 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

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

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
bad-request-entity object
errors object[]
logged-request object
method string

The HTTP request method

url string

The path and query to match exactly against

absoluteUrl string

The full URL to match against

headers object

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

cookies object

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

body string

Body string to match against

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

scenario object
id string

The scenario ID

name string

The scenario name

possibleStates string[]
state string

The current state of this scenario

Default: "Started"
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