Request Validator

Enterprise only

Log invalid requests without blockingv3.16+

Run the Request Validator plugin in tap mode.

In tap mode, validation runs as normal, but failed requests aren’t blocked. Instead, Kong Gateway logs a warning with the validation details and proxies the request to the upstream service unchanged.

Configure the plugin to use the kong validator to check that the request body contains a name field with a string value, and set config.enforcement_mode to log_only so that requests failing validation are logged instead of blocked.

In this example, an empty body ({}) is proxied through unchanged with a 200 response. Kong Gateway logs:

``` [warn] request-validator: validation failed in log_only mode, validation_category=body_schema, {“message”:”required field missing: name”}

When config.verbose_response is enabled, the log names the specific field that failed. When it’s disabled, it logs a generic validation-failure message instead.

Set up the plugin

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!