Configuration

configobject
Hide Child Parameters
api_specificationstring

The contents of the specification file. You must use this option for hybrid or DB-less mode. You can include the full specification as part of the configuration. In Kong Manager, you can copy and paste the contents of the spec directly into the Config.Api Specification text field.

api_specification_filenamestring

The path and name of the specification file loaded into Kong Gateway’s database. You cannot use this option for DB-less or hybrid mode.

custom_base_pathstring

The base path to be used for path match evaluation. This value is ignored if include_base_path is set to false.

include_base_pathboolean

Indicates whether to include the base path when performing path match evaluation.

Default:false

included_status_codesarray[integer]

A global list of the HTTP status codes that can only be selected and returned.

max_delay_timenumber

The maximum value in seconds of delay time. Set this value when random_delay is enabled and you want to adjust the default. The value must be greater than the min_delay_time.

Default:1

min_delay_timenumber

The minimum value in seconds of delay time. Set this value when random_delay is enabled and you want to adjust the default. The value must be less than the max_delay_time.

Default:0.001

random_delayboolean

Enables a random delay in the mocked response. Introduces delays to simulate real-time response times by APIs.

Default:false

random_examplesboolean

Randomly selects one example and returns it. This parameter requires the spec to have multiple examples configured.

Default:false

random_status_codeboolean

Determines whether to randomly select an HTTP status code from the responses of the corresponding API method. The default value is false, which means the minimum HTTP status code is always selected and returned.

Default:false

consumerobject

If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
protocolsarray[string]

A set of strings representing HTTP protocols.

Allowed values:grpcgrpcshttphttps

Default:grpc, grpcs, http, https

routeobject

If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
serviceobject

If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!