Skip to main content
The 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

The wiremock.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.json

Root structure

Global configuration

The global section contains configuration that applies to all services by default.

Global HTTPS settings

When a global certificate is configured, all services with an https section will use it by default unless they specify their own certificate.

Services

The services 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 https must 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
This field is automatically populated when pulling a mock API from WireMock Cloud.

path

Path to the directory containing stub mappings, files, and API specifications. The path is relative to the location of wiremock.yaml.
  • Type: string
  • Required: No
This directory typically contains items needed to run the service. For example:
  • stub-mappings.yaml - Stub mapping yaml file
  • schema.graphql or openapi.yaml - Mock API IDL documents such as OpenAPI/GraphQL schema

open_api

OpenAPI-specific configuration for validation.
  • Type: object
  • Required: No
Properties:
  • validation_mode - Controls OpenAPI request/response validation
    • Type: string
    • Valid values: none, soft, hard
    • Default: none
    • none - No validation
    • soft - Validation warnings logged but requests not rejected
    • hard - Invalid requests are rejected

https

HTTPS configuration for the service. See the TLS/HTTPS Configuration section below.
  • Type: object
  • Required: No (but either port or https must be provided)

originals

Map of original service URLs for recording and proxying.
  • Type: object
  • Required: No
The keys in this map can be referenced when using recording features to specify which target service to record from.

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.

HTTPS service configuration

Properties:
  • 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.
The path can be absolute or relative to the wiremock.yaml file. PEM file format:

PKCS12 or JKS keystore

A keystore file (PKCS12 or JKS format) containing the private key and certificate.
Properties:
  • keystore - Path to the keystore file (absolute or relative to wiremock.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 named wiremock-<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.

Complete example

See also