Mocking Configuration
Configuration reference for the Mocking plugin (`mocking`): the parameters, each attribute with its type, whether it is required, its default and its accepted values.
Parameters
See plugin common configurations (opens in Apache APISIX docs) for configuration options available to all plugins.
delay — integer · optional · default: 0 · since APISIX 2.13.0 · API7 Gateway 3.4.0
Mock response delay in seconds.
response_status — integer · optional · default: 200 · since APISIX 2.13.0 · API7 Gateway 3.4.0
HTTP status code of the mock response.
content_type — string · optional · default: application/json;charset=utf8 · since APISIX 2.13.0 · API7 Gateway 3.4.0
`Content-Type` header of the mock response.
response_example — string · optional · since APISIX 2.13.0 · API7 Gateway 3.4.0
Response body of the mock response. Support the use of built-in variables (opens in Apache APISIX docs) in the body.
At least one of the response_example and response_schema should be configured.
response_schema — object · optional · since APISIX 2.13.0 · API7 Gateway 3.4.0
Response JSON Schema. The JSON schema supports string, number, integer, boolean, object, and array in data types.
At least one of the response_example and response_schema should be configured. response_schema is only effective when response_example is not configured.
with_mock_header — boolean · optional · default: true · since APISIX 2.13.0 · API7 Gateway 3.4.0
If true, add a response header x-mock-by with APISIX version.
response_headers — object · optional · since APISIX 3.5.0 · API7 Gateway 3.4.0
Headers to be added in the mock response.