API7 Docs
TransformationMocking

Mocking Configuration

Parameters

See plugin common configurations for configuration options available to all plugins.

  • delayinteger · optional · default: 0

    Mock response delay in seconds.

  • response_statusinteger · optional · default: 200

    HTTP status code of the mock response.

  • content_typestring · optional · default: application/json;charset=utf8

    `Content-Type` header of the mock response.

  • response_examplestring · optional

    Response body of the mock response. Support the use of built-in variables in the body.

    At least one of the response_example and response_schema should be configured.

  • response_schemaobject · optional

    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_headerboolean · optional · default: true

    If true, add a response header x-mock-by with APISIX version.

  • response_headersobject · optional

    Headers to be added in the mock response.