mockd.yaml
mockd multi-protocol API mock server configuration file. See https://mockd.io
| 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
Configuration file for mockd, a multi-protocol API mock server supporting HTTP, GraphQL, gRPC, WebSocket, MQTT, SSE, SOAP, and OAuth
Properties
Configuration file version
Name of this mock collection
List of mock endpoint definitions
Deprecated: Prefer tables + extend pattern. Legacy stateful CRUD resources that persist data across requests.
Multi-step operations on stateful resources
Import API specs (OpenAPI, Swagger, WSDL, etc.) and namespace their mocks
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
Logical groupings of mocks. Each workspace provides isolated mock environments within a single mockd instance.
Server-level configuration for ports, TLS, CORS, rate limiting, etc.
12 nested properties
Read timeout in seconds
Write timeout in seconds
4 nested properties
6 nested properties
3 nested properties
Chaos fault injection configuration
3 nested properties
3 nested properties
Definitions
A workspace defines a logical grouping of mocks.
Unique name for this workspace (required)
Human-readable description of this workspace
Engine names this workspace is assigned to
A mock endpoint definition. The 'type' field determines which protocol spec to use.
Unique identifier for this mock. Auto-generated if omitted.
Protocol type for this mock
Human-readable name for this mock
Description of what this mock does
Whether this mock is active (default: true)
Folder this mock belongs to
Workspace this mock belongs to
HTTP mock specification
7 nested properties
Match priority (higher wins when multiple mocks match)
Request matching rules
10 nested properties
HTTP method to match
URL path to match. Supports {param} patterns (e.g., /api/users/{id})
Regex pattern for path matching (mutually exclusive with path)
Headers to match (glob patterns with * supported)
Query parameters to match (exact match)
Match requests containing this substring in the body
Match requests with this exact body
Regex pattern to match against the request body
JSONPath expressions to match against the request body
mTLS client certificate matching
Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}
5 nested properties
HTTP status code
Response headers
Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.
Path to a file to use as the response body (relative to config file)
Response delay in milliseconds
Server-Sent Events configuration (mutually exclusive with response)
1 nested properties
Chunked transfer encoding configuration
4 nested properties
Delay between chunks in ms
Name of a custom operation to execute instead of a static response
WebSocket mock specification
8 nested properties
WebSocket endpoint path
Echo received messages back
Duration string (e.g., '30s')
2 nested properties
GraphQL mock specification
6 nested properties
GraphQL endpoint path
Inline GraphQL SDL schema
Path to GraphQL schema file
Enable introspection queries
Map of operation names to resolver configs
Map of subscription names to configs
gRPC mock specification
6 nested properties
gRPC server port
Path to .proto file
Enable gRPC reflection
Map of service names to configs
SOAP mock specification
4 nested properties
SOAP endpoint path
Path to WSDL file
Inline WSDL content
Map of operation names to configs
MQTT mock broker specification
4 nested properties
MQTT broker port
3 nested properties
2 nested properties
OAuth 2.0 / OIDC mock provider specification
6 nested properties
OAuth issuer URL
Token expiry duration (e.g., '1h')
HTTP mock specification
Match priority (higher wins when multiple mocks match)
Request matching rules
10 nested properties
HTTP method to match
URL path to match. Supports {param} patterns (e.g., /api/users/{id})
Regex pattern for path matching (mutually exclusive with path)
Headers to match (glob patterns with * supported)
Query parameters to match (exact match)
Match requests containing this substring in the body
Match requests with this exact body
Regex pattern to match against the request body
JSONPath expressions to match against the request body
mTLS client certificate matching
6 nested properties
Common Name to match
Regex pattern for CN
Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}
5 nested properties
HTTP status code
Response headers
Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.
Path to a file to use as the response body (relative to config file)
Response delay in milliseconds
Server-Sent Events configuration (mutually exclusive with response)
1 nested properties
Chunked transfer encoding configuration
4 nested properties
Delay between chunks in ms
Name of a custom operation to execute instead of a static response
Request matching rules
HTTP method to match
URL path to match. Supports {param} patterns (e.g., /api/users/{id})
Regex pattern for path matching (mutually exclusive with path)
Headers to match (glob patterns with * supported)
Query parameters to match (exact match)
Match requests containing this substring in the body
Match requests with this exact body
Regex pattern to match against the request body
JSONPath expressions to match against the request body
mTLS client certificate matching
6 nested properties
Common Name to match
Regex pattern for CN
Response configuration. Supports template expressions like {{uuid}}, {{faker.name}}, {{request.Path}}
HTTP status code
Response headers
Response body (string or JSON object). Supports template expressions: {{uuid}}, {{faker.name}}, {{faker.email}}, {{now}}, {{random.Int 1 100}}, {{request.Method}}, etc.
Path to a file to use as the response body (relative to config file)
Response delay in milliseconds
WebSocket mock specification
WebSocket endpoint path
Echo received messages back
Duration string (e.g., '30s')
2 nested properties
GraphQL mock specification
GraphQL endpoint path
Inline GraphQL SDL schema
Path to GraphQL schema file
Enable introspection queries
Map of operation names to resolver configs
Map of subscription names to configs
gRPC mock specification
gRPC server port
Path to .proto file
Enable gRPC reflection
Map of service names to configs
SOAP mock specification
SOAP endpoint path
Path to WSDL file
Inline WSDL content
Map of operation names to configs
MQTT mock broker specification
MQTT broker port
3 nested properties
2 nested properties
OAuth 2.0 / OIDC mock provider specification
OAuth issuer URL
Token expiry duration (e.g., '1h')
A stateful CRUD resource that persists data across requests
Resource name (used in URLs)
Field to use as item ID
ID generation strategy
ID prefix when idStrategy is 'prefix' (e.g., 'cus_')
Foreign key field for nested resources (e.g., filter sub-resources by parent ID)
Maximum items in the collection
Initial data to populate the resource
Validation rules for create/update operations
3 nested properties
Response transform configuration for shaping stateful resource responses
6 nested properties
2 nested properties
Timestamp format
Field rename map (e.g., createdAt → created)
4 nested properties
Fields to inject into every item
Fields to hide from responses
Rename field keys in responses (key is original name, value is output name)
Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.
3 nested properties
Name of the array field (default: 'data')
Extra fields on list response
Hide the default meta object
1 nested properties
HTTP status for create (default: 201)
3 nested properties
HTTP status for delete (default: 204)
Custom delete response body (supports {{item.field}} templates)
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.
4 nested properties
Wrap error in a named object (e.g., 'error')
Maps field names to related tables for ?expand[] support
A multi-step operation on stateful resources (e.g., TransferFunds)
Operation name
Expression map for the response
Server-level configuration for ports, TLS, CORS, rate limiting, etc.
Read timeout in seconds
Write timeout in seconds
4 nested properties
6 nested properties
3 nested properties
Chaos fault injection configuration
3 nested properties
3 nested properties
Chaos fault injection configuration
3 nested properties
3 nested properties
2 nested properties
2 nested properties
Request validation rules
Field validation rules
Custom error message
An API spec import with optional namespace
File path to the API spec (relative to config file)
URL to fetch the API spec from (alternative to path)
Namespace prefix for imported mocks (e.g., 'stripe')
Explicit format (auto-detected if omitted)
A stateful data table definition
Table name (e.g., 'customers')
Field to use as item ID
ID generation strategy
ID prefix when idStrategy is 'prefix' (e.g., 'cus_')
Maximum items in the collection
Foreign key field for nested resources
Initial data to populate the table
Validation rules for create/update operations
Response transform configuration for shaping stateful resource responses
6 nested properties
2 nested properties
Timestamp format
Field rename map (e.g., createdAt → created)
4 nested properties
Fields to inject into every item
Fields to hide from responses
Rename field keys in responses (key is original name, value is output name)
Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.
3 nested properties
Name of the array field (default: 'data')
Extra fields on list response
Hide the default meta object
1 nested properties
HTTP status for create (default: 201)
3 nested properties
HTTP status for delete (default: 204)
Custom delete response body (supports {{item.field}} templates)
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.
4 nested properties
Wrap error in a named object (e.g., 'error')
Maps field names to related tables for ?expand[] support
Foreign key relationship to another table for ?expand[] support
Target table name
Field in target table to match (defaults to target's idField)
Binds an imported mock to a table with a specific action
Mock reference: namespaced operationId (e.g., 'stripe.PostCustomers') or 'METHOD /path'
Target table name
Action to perform
Custom operation name (required when action is 'custom')
Response transform configuration for shaping stateful resource responses
6 nested properties
2 nested properties
Timestamp format
Field rename map (e.g., createdAt → created)
4 nested properties
Fields to inject into every item
Fields to hide from responses
Rename field keys in responses (key is original name, value is output name)
Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.
3 nested properties
Name of the array field (default: 'data')
Extra fields on list response
Hide the default meta object
1 nested properties
HTTP status for create (default: 201)
3 nested properties
HTTP status for delete (default: 204)
Custom delete response body (supports {{item.field}} templates)
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.
4 nested properties
Wrap error in a named object (e.g., 'error')
Response transform configuration for shaping stateful resource responses
2 nested properties
Timestamp format
Field rename map (e.g., createdAt → created)
4 nested properties
Fields to inject into every item
Fields to hide from responses
Rename field keys in responses (key is original name, value is output name)
Wraps specified array fields in list object envelopes ({object: 'list', data: [...], has_more: false}). Key is field name, value is envelope config.
3 nested properties
Name of the array field (default: 'data')
Extra fields on list response
Hide the default meta object
1 nested properties
HTTP status for create (default: 201)
3 nested properties
HTTP status for delete (default: 204)
Custom delete response body (supports {{item.field}} templates)
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.
4 nested properties
Wrap error in a named object (e.g., 'error')
Configuration for wrapping an array field in a list object envelope. Null means default envelope with no URL.
URL template for the sub-resource list. Supports {{fieldName}} substitution from the parent item.