Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
OpenAPI
Imports
Take a snapshot recording
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
The ID of the Mock API
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
Criteria for extracting response bodies to a separate file instead of including it in the stub mapping
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
Whether to save stub mappings to the file system or just return them
When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded
Control the request body matcher used in generated stub mappings
If equalTo is used, match body use case-insensitive string comparison
If equalToJson is used, ignore order of array elements
If equalToJson is used, matcher ignores extra elements in objects
List of names of stub mappings transformers to apply to generated stubs
Parameters to pass to stub mapping transformers
Filter requests for which to create stub mapping
The scheme (protocol) part of the request URL
The hostname part of the request URL
The HTTP port number of the request URL
The HTTP request method e.g. GET
The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.
Query parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form
application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form
Header patterns to match against in the <key>: { "<predicate>": "<value>" } form
Pre-emptive basic auth credentials to match against
Cookie patterns to match against in the <key>: { "<predicate>": "<value>" } form
Request body patterns to match against in the <key>: { "<predicate>": "<value>" } form
Require the state of the Mock API to match the provided patterns. More information on this feature can be found here.
Multipart patterns to match against headers and body.
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
The ID of the Mock API
5 - 10
Body
Criteria for extracting response bodies to a separate file instead of including it in the stub mapping
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
Whether to save stub mappings to the file system or just return them
When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded
Control the request body matcher used in generated stub mappings
If equalTo is used, match body use case-insensitive string comparison
If equalToJson is used, ignore order of array elements
If equalToJson is used, matcher ignores extra elements in objects
auto
List of names of stub mappings transformers to apply to generated stubs
Parameters to pass to stub mapping transformers
Filter requests for which to create stub mapping
The scheme (protocol) part of the request URL
http
, https
The hostname part of the request URL
The HTTP port number of the request URL
1 < x < 65535
The HTTP request method e.g. GET
The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.
Require the state of the Mock API to match the provided patterns. More information on this feature can be found here.
require-state
The context of the item to match. Can be templated.
The key of the item to match. Cannot be templated.
Multipart patterns to match against headers and body.
Determines whether all or any of the parts must match the criteria for an overall match.
ALL
, ANY
Response
This stub mapping's unique identifier
Alias for the id
The stub mapping's name
The scheme (protocol) part of the request URL
http
, https
The hostname part of the request URL
The HTTP port number of the request URL
1 < x < 65535
The HTTP request method e.g. GET
The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.
Require the state of the Mock API to match the provided patterns. More information on this feature can be found here.
Multipart patterns to match against headers and body.
Determines whether all or any of the parts must match the criteria for an overall match.
ALL
, ANY
Header patterns to match against in the <key>: { "<predicate>": "<value>" } form
The HTTP status code to be returned
The HTTP status message to be returned
Map of response headers to send
Extra request headers to send when proxying to another host.
Request headers to remove when proxying to another host.
The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
A base64 encoded string used to describe binary data.
The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
The fault to apply (instead of a full, valid response).
CONNECTION_RESET_BY_PEER
, EMPTY_RESPONSE
, MALFORMED_RESPONSE_CHUNK
, RANDOM_DATA_THEN_CLOSE
Number of milliseconds to delay be before sending the response.
The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.
Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.
The base URL of the target to proxy matching requests to.
A path segment to remove from the beginning in incoming request URL paths before proxying to the target.
Parameters to apply to response transformers.
List of names of transformers to apply to this response.
Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.
This stub mapping's priority relative to others. 1 is highest.
x > 1
The name of the scenario that this stub mapping is part of
The required state of the scenario in order for this stub to be matched.
The new state for the scenario to be updated to after this stub is served.
A map of the names of post serve action extensions to trigger and their parameters.
The list of serve event listeners
change-state
The operation to perform. * SET
- set the value of a state item in the state cache. * DELETE
- delete a state item from the state cache. * REQUEST_VAR
- set a variable that will be available for the lifetime of the request.
SET
, DELETE
, REQUEST_VAR
The context of the item to perform the operation on. Relevant only when operation
is SET
or DELETE
. Can be templated.
The key of the item to perform the operation on. Cannot be templated.
The value to set the item to. Relevant only when operation
is SET
or REQUEST_VAR
. Can be templated.
Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.