Type object
File match mockd.yaml mockd.yml mockd.json .mockd.yaml .mockd.yml .mockd.json mocks.yaml mocks.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/mockd-yaml/latest.json
Source https://raw.githubusercontent.com/getmockd/mockd/main/schema/mockd.schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Configuration file for mockd, a multi-protocol API mock server supporting HTTP, GraphQL, gRPC, WebSocket, MQTT, SSE, SOAP, and OAuth

Properties

version string

Configuration file version

name string

Name of this mock collection

mocks mock[]

List of mock endpoint definitions

statefulResources statefulResource[]

Deprecated: Prefer tables + extend pattern. Legacy stateful CRUD resources that persist data across requests.

customOperations customOperation[]

Multi-step operations on stateful resources

imports importEntry[]

Import API specs (OpenAPI, Swagger, WSDL, etc.) and namespace their mocks

tables tableConfig[]

Stateful data tables. Tables are pure data stores with no routing — endpoints are bound via extend.

Bind imported mocks to stateful tables with explicit actions

workspaces workspaceConfig[]

Logical groupings of mocks. Each workspace provides isolated mock environments within a single mockd instance.

serverConfig object

Server-level configuration for ports, TLS, CORS, rate limiting, etc.

12 nested properties
httpPort integer
Default: 4280
httpsPort integer
Default: 0
adminPort integer
Default: 4290
logRequests boolean
maxLogEntries integer
readTimeout integer

Read timeout in seconds

writeTimeout integer

Write timeout in seconds

maxConnections integer
tls object
4 nested properties
enabled boolean
certFile string
keyFile string
autoGenerateCert boolean
cors object
6 nested properties
enabled boolean
allowOrigins string[]
allowMethods string[]
allowHeaders string[]
allowCredentials boolean
maxAge integer
rateLimit object
3 nested properties
enabled boolean
requestsPerSecond number
burstSize integer
chaos object

Chaos fault injection configuration

3 nested properties
enabled boolean
global object
3 nested properties
latency object
errorRate object
bandwidth object
rules object[]

Definitions

workspaceConfig object

A workspace defines a logical grouping of mocks.

name string required

Unique name for this workspace (required)

description string

Human-readable description of this workspace

engines string[]

Engine names this workspace is assigned to

mock object

A mock endpoint definition. The 'type' field determines which protocol spec to use.

id string

Unique identifier for this mock. Auto-generated if omitted.

type string

Protocol type for this mock

Values: "http" "websocket" "graphql" "grpc" "soap" "mqtt" "oauth"
name string

Human-readable name for this mock

description string

Description of what this mock does

enabled boolean

Whether this mock is active (default: true)

Default: true
folderId string

Folder this mock belongs to

workspaceId string

Workspace this mock belongs to

http object

HTTP mock specification

7 nested properties
priority integer

Match priority (higher wins when multiple mocks match)

Default: 0
matcher object

Request matching rules

10 nested properties
method string

HTTP method to match

Values: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS"
path string

URL path to match. Supports {param} patterns (e.g., /api/users/{id})

pathPattern string

Regex pattern for path matching (mutually exclusive with path)

headers Record<string, string>

Headers to match (glob patterns with * supported)

queryParams Record<string, string>

Query parameters to match (exact match)

bodyContains string

Match requests containing this substring in the body

bodyEquals string

Match requests with this exact body

bodyPattern string

Regex pattern to match against the request body

bodyJsonPath object

JSONPath expressions to match against the request body

mtls object

mTLS client certificate matching

response object

Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}

5 nested properties
statusCode integer

HTTP status code

Default: 200
min=100max=599
headers Record<string, string>

Response headers

body

Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.

bodyFile string

Path to a file to use as the response body (relative to config file)

delayMs integer

Response delay in milliseconds

Default: 0
min=0
sse object

Server-Sent Events configuration (mutually exclusive with response)

1 nested properties
events object[]
chunked object

Chunked transfer encoding configuration

4 nested properties
chunkSize integer
chunkDelay integer

Delay between chunks in ms

data string
dataFile string
validation object

Request validation rules

4 nested properties
required string[]
fields Record<string, object>
mode string
Values: "strict" "warn" "permissive"
failStatus integer
statefulOperation string

Name of a custom operation to execute instead of a static response

websocket object

WebSocket mock specification

8 nested properties
path string required

WebSocket endpoint path

subprotocols string[]
echoMode boolean

Echo received messages back

maxMessageSize integer
maxConnections integer
idleTimeout string

Duration string (e.g., '30s')

matchers object[]
heartbeat object
2 nested properties
enabled boolean
interval string
graphql object

GraphQL mock specification

6 nested properties
path string required

GraphQL endpoint path

schema string

Inline GraphQL SDL schema

schemaFile string

Path to GraphQL schema file

introspection boolean

Enable introspection queries

resolvers Record<string, object>

Map of operation names to resolver configs

subscriptions Record<string, object>

Map of subscription names to configs

grpc object

gRPC mock specification

6 nested properties
port integer

gRPC server port

protoFile string

Path to .proto file

protoFiles string[]
importPaths string[]
reflection boolean

Enable gRPC reflection

services Record<string, object>

Map of service names to configs

soap object

SOAP mock specification

4 nested properties
path string required

SOAP endpoint path

wsdlFile string

Path to WSDL file

wsdl string

Inline WSDL content

operations Record<string, object>

Map of operation names to configs

mqtt object

MQTT mock broker specification

4 nested properties
port integer

MQTT broker port

tls object
3 nested properties
enabled boolean
certFile string
keyFile string
auth object
2 nested properties
enabled boolean
users object[]
topics object[]
oauth object

OAuth 2.0 / OIDC mock provider specification

6 nested properties
issuer string required

OAuth issuer URL

tokenExpiry string

Token expiry duration (e.g., '1h')

refreshExpiry string
defaultScopes string[]
clients object[]
users object[]
httpSpec object

HTTP mock specification

priority integer

Match priority (higher wins when multiple mocks match)

Default: 0
matcher object

Request matching rules

10 nested properties
method string

HTTP method to match

Values: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS"
path string

URL path to match. Supports {param} patterns (e.g., /api/users/{id})

pathPattern string

Regex pattern for path matching (mutually exclusive with path)

headers Record<string, string>

Headers to match (glob patterns with * supported)

queryParams Record<string, string>

Query parameters to match (exact match)

bodyContains string

Match requests containing this substring in the body

bodyEquals string

Match requests with this exact body

bodyPattern string

Regex pattern to match against the request body

bodyJsonPath object

JSONPath expressions to match against the request body

mtls object

mTLS client certificate matching

6 nested properties
requireAuth boolean
cn string

Common Name to match

cnPattern string

Regex pattern for CN

ou string
o string
fingerprint string
response object

Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}

5 nested properties
statusCode integer

HTTP status code

Default: 200
min=100max=599
headers Record<string, string>

Response headers

body

Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.

bodyFile string

Path to a file to use as the response body (relative to config file)

delayMs integer

Response delay in milliseconds

Default: 0
min=0
sse object

Server-Sent Events configuration (mutually exclusive with response)

1 nested properties
events object[]
chunked object

Chunked transfer encoding configuration

4 nested properties
chunkSize integer
chunkDelay integer

Delay between chunks in ms

data string
dataFile string
validation object

Request validation rules

4 nested properties
required string[]
fields Record<string, object>
mode string
Values: "strict" "warn" "permissive"
failStatus integer
statefulOperation string

Name of a custom operation to execute instead of a static response

httpMatcher object

Request matching rules

method string

HTTP method to match

Values: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS"
path string

URL path to match. Supports {param} patterns (e.g., /api/users/{id})

pathPattern string

Regex pattern for path matching (mutually exclusive with path)

headers Record<string, string>

Headers to match (glob patterns with * supported)

queryParams Record<string, string>

Query parameters to match (exact match)

bodyContains string

Match requests containing this substring in the body

bodyEquals string

Match requests with this exact body

bodyPattern string

Regex pattern to match against the request body

bodyJsonPath object

JSONPath expressions to match against the request body

mtls object

mTLS client certificate matching

6 nested properties
requireAuth boolean
cn string

Common Name to match

cnPattern string

Regex pattern for CN

ou string
o string
fingerprint string
httpResponse object

Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}

statusCode integer

HTTP status code

Default: 200
min=100max=599
headers Record<string, string>

Response headers

body

Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.

bodyFile string

Path to a file to use as the response body (relative to config file)

delayMs integer

Response delay in milliseconds

Default: 0
min=0
websocketSpec object

WebSocket mock specification

path string required

WebSocket endpoint path

subprotocols string[]
echoMode boolean

Echo received messages back

maxMessageSize integer
maxConnections integer
idleTimeout string

Duration string (e.g., '30s')

matchers object[]
heartbeat object
2 nested properties
enabled boolean
interval string
graphqlSpec object

GraphQL mock specification

path string required

GraphQL endpoint path

schema string

Inline GraphQL SDL schema

schemaFile string

Path to GraphQL schema file

introspection boolean

Enable introspection queries

resolvers Record<string, object>

Map of operation names to resolver configs

subscriptions Record<string, object>

Map of subscription names to configs

grpcSpec object

gRPC mock specification

port integer

gRPC server port

protoFile string

Path to .proto file

protoFiles string[]
importPaths string[]
reflection boolean

Enable gRPC reflection

services Record<string, object>

Map of service names to configs

soapSpec object

SOAP mock specification

path string required

SOAP endpoint path

wsdlFile string

Path to WSDL file

wsdl string

Inline WSDL content

operations Record<string, object>

Map of operation names to configs

mqttSpec object

MQTT mock broker specification

port integer

MQTT broker port

tls object
3 nested properties
enabled boolean
certFile string
keyFile string
auth object
2 nested properties
enabled boolean
users object[]
topics object[]
oauthSpec object

OAuth 2.0 / OIDC mock provider specification

issuer string required

OAuth issuer URL

tokenExpiry string

Token expiry duration (e.g., '1h')

refreshExpiry string
defaultScopes string[]
clients object[]
users object[]
statefulResource object

A stateful CRUD resource that persists data across requests

name string required

Resource name (used in URLs)

idField string

Field to use as item ID

Default: "id"
idStrategy string

ID generation strategy

Values: "uuid" "prefix" "ulid" "sequence" "short"
idPrefix string

ID prefix when idStrategy is 'prefix' (e.g., 'cus_')

parentField string

Foreign key field for nested resources (e.g., filter sub-resources by parent ID)

maxItems integer

Maximum items in the collection

seedData object[]

Initial data to populate the resource

validation object

Validation rules for create/update operations

3 nested properties
auto boolean

Auto-infer validation from seed data

required string[]
fields Record<string, object>
response object

Response transform configuration for shaping stateful resource responses

6 nested properties
timestamps object
2 nested properties
format string

Timestamp format

Values: "unix" "iso8601" "rfc3339" "none"
fields Record<string, string>

Field rename map (e.g., createdAt → created)

fields object
4 nested properties
inject object

Fields to inject into every item

hide string[]

Fields to hide from responses

rename Record<string, string>

Rename field keys in responses (key is original name, value is output name)

wrapAsList Record<string, object | null>

Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.

list object
3 nested properties
dataField string

Name of the array field (default: 'data')

extraFields object

Extra fields on list response

hideMeta boolean

Hide the default meta object

create object
1 nested properties
status integer

HTTP status for create (default: 201)

delete object
3 nested properties
status integer

HTTP status for delete (default: 204)

body object

Custom delete response body (supports {{item.field}} templates)

preserve boolean

When true, the item is not removed from the store. DELETE returns the configured response but the data is preserved. Useful for soft-delete APIs.

errors object
4 nested properties
wrap string

Wrap error in a named object (e.g., 'error')

fields Record<string, string>
typeMap Record<string, string>
codeMap Record<string, string>
relationships Record<string, object>

Maps field names to related tables for ?expand[] support

customOperation object

A multi-step operation on stateful resources (e.g., TransferFunds)

name string required

Operation name

steps object[] required
consistency string
Default: "best_effort"
Values: "best_effort" "atomic"
response Record<string, string>

Expression map for the response

serverConfig object

Server-level configuration for ports, TLS, CORS, rate limiting, etc.

httpPort integer
Default: 4280
httpsPort integer
Default: 0
adminPort integer
Default: 4290
logRequests boolean
maxLogEntries integer
readTimeout integer

Read timeout in seconds

writeTimeout integer

Write timeout in seconds

maxConnections integer
tls object
4 nested properties
enabled boolean
certFile string
keyFile string
autoGenerateCert boolean
cors object
6 nested properties
enabled boolean
allowOrigins string[]
allowMethods string[]
allowHeaders string[]
allowCredentials boolean
maxAge integer
rateLimit object
3 nested properties
enabled boolean
requestsPerSecond number
burstSize integer
chaos object

Chaos fault injection configuration

3 nested properties
enabled boolean
global object
3 nested properties
latency object
errorRate object
bandwidth object
rules object[]
chaosConfig object

Chaos fault injection configuration

enabled boolean
global object
3 nested properties
latency object
3 nested properties
min string
max string
probability number
min=0max=1
errorRate object
2 nested properties
probability number
min=0max=1
statusCodes integer[]
bandwidth object
2 nested properties
bytesPerSecond integer
probability number
min=0max=1
rules object[]
requestValidation object

Request validation rules

required string[]
fields Record<string, object>
mode string
Values: "strict" "warn" "permissive"
failStatus integer
fieldValidator object

Field validation rules

type string
Values: "string" "number" "integer" "boolean" "array" "object"
required boolean
nullable boolean
minLength integer
maxLength integer
pattern string
format string
Values: "email" "uuid" "date" "datetime" "uri" "ipv4" "ipv6" "hostname"
min number
max number
minItems integer
maxItems integer
uniqueItems boolean
enum array
message string

Custom error message

importEntry object

An API spec import with optional namespace

path string required

File path to the API spec (relative to config file)

url string

URL to fetch the API spec from (alternative to path)

as string

Namespace prefix for imported mocks (e.g., 'stripe')

format string

Explicit format (auto-detected if omitted)

Values: "openapi" "swagger" "postman" "har" "wiremock" "wsdl" "mockoon" "curl" "yaml" "json"
tableConfig object

A stateful data table definition

name string required

Table name (e.g., 'customers')

idField string

Field to use as item ID

Default: "id"
idStrategy string

ID generation strategy

Values: "uuid" "prefix" "ulid" "sequence" "short"
idPrefix string

ID prefix when idStrategy is 'prefix' (e.g., 'cus_')

maxItems integer

Maximum items in the collection

parentField string

Foreign key field for nested resources

seedData object[]

Initial data to populate the table

validation object

Validation rules for create/update operations

response object

Response transform configuration for shaping stateful resource responses

6 nested properties
timestamps object
2 nested properties
format string

Timestamp format

Values: "unix" "iso8601" "rfc3339" "none"
fields Record<string, string>

Field rename map (e.g., createdAt → created)

fields object
4 nested properties
inject object

Fields to inject into every item

hide string[]

Fields to hide from responses

rename Record<string, string>

Rename field keys in responses (key is original name, value is output name)

wrapAsList Record<string, object | null>

Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.

list object
3 nested properties
dataField string

Name of the array field (default: 'data')

extraFields object

Extra fields on list response

hideMeta boolean

Hide the default meta object

create object
1 nested properties
status integer

HTTP status for create (default: 201)

delete object
3 nested properties
status integer

HTTP status for delete (default: 204)

body object

Custom delete response body (supports {{item.field}} templates)

preserve boolean

When true, the item is not removed from the store. DELETE returns the configured response but the data is preserved. Useful for soft-delete APIs.

errors object
4 nested properties
wrap string

Wrap error in a named object (e.g., 'error')

fields Record<string, string>
typeMap Record<string, string>
codeMap Record<string, string>
relationships Record<string, object>

Maps field names to related tables for ?expand[] support

relationship object

Foreign key relationship to another table for ?expand[] support

table string required

Target table name

field string

Field in target table to match (defaults to target's idField)

extendBinding object

Binds an imported mock to a table with a specific action

mock string required

Mock reference: namespaced operationId (e.g., 'stripe.PostCustomers') or 'METHOD /path'

table string required

Target table name

action string required

Action to perform

Values: "create" "get" "list" "update" "patch" "delete" "custom"
operation string

Custom operation name (required when action is 'custom')

response object

Response transform configuration for shaping stateful resource responses

6 nested properties
timestamps object
2 nested properties
format string

Timestamp format

Values: "unix" "iso8601" "rfc3339" "none"
fields Record<string, string>

Field rename map (e.g., createdAt → created)

fields object
4 nested properties
inject object

Fields to inject into every item

hide string[]

Fields to hide from responses

rename Record<string, string>

Rename field keys in responses (key is original name, value is output name)

wrapAsList Record<string, object | null>

Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.

list object
3 nested properties
dataField string

Name of the array field (default: 'data')

extraFields object

Extra fields on list response

hideMeta boolean

Hide the default meta object

create object
1 nested properties
status integer

HTTP status for create (default: 201)

delete object
3 nested properties
status integer

HTTP status for delete (default: 204)

body object

Custom delete response body (supports {{item.field}} templates)

preserve boolean

When true, the item is not removed from the store. DELETE returns the configured response but the data is preserved. Useful for soft-delete APIs.

errors object
4 nested properties
wrap string

Wrap error in a named object (e.g., 'error')

fields Record<string, string>
typeMap Record<string, string>
codeMap Record<string, string>
responseTransform object

Response transform configuration for shaping stateful resource responses

timestamps object
2 nested properties
format string

Timestamp format

Values: "unix" "iso8601" "rfc3339" "none"
fields Record<string, string>

Field rename map (e.g., createdAt → created)

fields object
4 nested properties
inject object

Fields to inject into every item

hide string[]

Fields to hide from responses

rename Record<string, string>

Rename field keys in responses (key is original name, value is output name)

wrapAsList Record<string, object | null>

Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.

list object
3 nested properties
dataField string

Name of the array field (default: 'data')

extraFields object

Extra fields on list response

hideMeta boolean

Hide the default meta object

create object
1 nested properties
status integer

HTTP status for create (default: 201)

delete object
3 nested properties
status integer

HTTP status for delete (default: 204)

body object

Custom delete response body (supports {{item.field}} templates)

preserve boolean

When true, the item is not removed from the store. DELETE returns the configured response but the data is preserved. Useful for soft-delete APIs.

errors object
4 nested properties
wrap string

Wrap error in a named object (e.g., 'error')

fields Record<string, string>
typeMap Record<string, string>
codeMap Record<string, string>
listWrapConfig object | null

Configuration for wrapping an array field in a list object envelope. Null means default envelope with no URL.

url string

URL template for the sub-resource list. Supports {{fieldName}} substitution from the parent item.