Mocking Configuration
Parameters
See plugin common configurations for configuration options available to all plugins.
-
delay—integer· optional · default:0Mock response delay in seconds.
-
response_status—integer· optional · default:200HTTP status code of the mock response.
-
content_type—string· optional · default:application/json;charset=utf8`Content-Type` header of the mock response.
-
response_example—string· optionalResponse body of the mock response. Support the use of built-in variables in the body.
At least one of the
response_exampleandresponse_schemashould be configured. -
response_schema—object· optionalResponse JSON Schema. The JSON schema supports
string,number,integer,boolean,object, andarrayin data types.At least one of the
response_exampleandresponse_schemashould be configured.response_schemais only effective whenresponse_exampleis not configured. -
with_mock_header—boolean· optional · default:trueIf true, add a response header
x-mock-bywith APISIX version. -
response_headers—object· optionalHeaders to be added in the mock response.