wiremock.yaml file is used by the WireMock CLI to configure local mock services. It defines service configurations including HTTP/HTTPS ports, TLS certificates, API types, and cloud synchronization settings.
File location
Thewiremock.yaml file should be placed in your WireMock working directory (typically .wiremock by default, or as specified with the --wiremock-dir argument).
Schema validation
The configuration file conforms to the JSON Schema specification available at: https://static.wiremock.io/schemas/wiremock.yaml-schema.jsonRoot structure
Global configuration
Theglobal section contains configuration that applies to all services by default.
Global HTTPS settings
https section will use it by default unless they specify their own certificate.
Services
Theservices section is a map of service names to their configurations. Service names are user-defined identifiers.
Required service properties
Each service must define these properties:type
The type of mock API.- Type:
string - Required: Yes
- Valid values:
REST,Unstructured,gRPC,GraphQL(case insensitive)
name
Human-readable name for the service.- Type:
string - Required: Yes
port
HTTP port number for the service.- Type:
integer - Required: Yes (or
httpsmust be provided) - Valid range: 1-65535
Optional service properties
description
Optional description of the service.- Type:
string - Required: No
cloud_id
WireMock Cloud mock API ID for syncing with cloud.- Type:
string - Required: No
- Pattern: 4-15 lowercase alphanumeric characters
path
Path to the directory containing stub mappings, files, and API specifications. The path is relative to the location ofwiremock.yaml.
- Type:
string - Required: No
stub-mappings.yaml- Stub mapping yaml fileschema.graphqloropenapi.yaml- Mock API IDL documents such as OpenAPI/GraphQL schema
open_api
OpenAPI-specific configuration for validation.- Type:
object - Required: No
validation_mode- Controls OpenAPI request/response validation- Type:
string - Valid values:
none,soft,hard - Default:
none none- No validationsoft- Validation warnings logged but requests not rejectedhard- Invalid requests are rejected
- Type:
https
HTTPS configuration for the service. See the TLS/HTTPS Configuration section below.- Type:
object - Required: No (but either
portorhttpsmust be provided)
originals
Map of original service URLs for recording and proxying.- Type:
object - Required: No
Data sources
The optionaldata_sources section is a map of keys to the CSV and database data sources
that the services’ stubs use. It is shared by every service in the file. A stub’s data-exists matcher refers to a
data source by its key (or by its cloud_id). wiremock mock-apis pull writes these entries, wiremock run serves
the CSV ones, and wiremock mock-apis push creates or updates them in WireMock Cloud. See
Data sources in a project for how they work.
name
The data source’s name in WireMock Cloud. Names are unique in an organisation (exact, case-sensitive).- Type:
string - Required: Yes
type
- Type:
string - Required: No
- Values:
CSV(default) orDATABASE
DATABASE data sources are kept so that a project round-trips, but are not served by wiremock run and cannot be
pushed.
cloud_id
The data source’s ID in WireMock Cloud. Pull writes it, and push writes it back when it creates or adopts a data source. Leave it out when you write a new data source by hand.- Type:
string - Required: No
file
The data source’s CSV file, relative to the location ofwiremock.yaml. It must be inside the project directory.
Pull always writes data-sources/<key>.csv. See CSV file format.
- Type:
string - Required: Yes, for a CSV data source
columns
The data source’s columns, in order. When present, the CSV header must list the same names in the same order. When absent, the CSV header defines the columns, all of typeSTRING. Pull always writes it.
- Type: list of objects
- Required: No (CSV only)
name(required): the column name.type(required): one ofSTRING,INTEGER,DECIMAL,BOOLEAN,DATE,TIME,DATETIME.format(optional,DATE,TIMEandDATETIMEonly): a JavaDateTimeFormatterpattern, such asyyyy-MM-dd, oriso8601.zoned(optional,TIMEandDATETIMEonly):truewhen the values carry a time zone.
table_name
The table or view of aDATABASE data source. Not used locally.
- Type:
string - Required: No (DATABASE only)
TLS/HTTPS configuration
Services can be configured to run over HTTPS using TLS certificates. TLS can be configured globally (for all services) or per-service. For an overview of HTTPS and mutual TLS across WireMock Cloud and the CLI, see HTTPS and mutual TLS.HTTPS service configuration
port- HTTPS port number (required, 1-65535)certificate- Certificate configuration (optional, inherits from global if not specified)
Certificate configuration
Certificates can be configured in three ways:PEM file
A PEM-encoded file containing both the RSA private key and X509 certificate.wiremock.yaml file.
PEM file format:
PKCS12 or JKS keystore
A keystore file (PKCS12 or JKS format) containing the private key and certificate.keystore- Path to the keystore file (absolute or relative towiremock.yaml)password- Password to unlock the keystore (required)alias- Optional alias to select a specific certificate if the keystore contains multiple entries. If omitted, the first entry is used.
Certificate alias reference
When a global keystore is configured, individual services can reference specific certificates by alias:Default self-signed certificate
If no certificate is configured, services will use WireMock’s default self-signed certificate.Profiles
Configuration overrides can be defined in profile files namedwiremock-<profile-name>.yaml.
These files overlay the base configuration when running commands with the --profile/-p flag.
See Managing Environments for more information about using profiles to manage environments in WireMock Cloud.