# Request Validation Configuration

The `request-validation` plugin checks requests for compliance before forwarding them to upstream services, enhancing security in API operations.<!-- --> <!-- -->Configuration covers static settings and plugin parameters.

## Static Configurations[​](#static-configurations "Direct link to Static Configurations")

The `apisix.max_request_headers_readable` setting controls how many request headers are available when `request-validation` evaluates `header_schema`. It is available in APISIX 3.20.0 and API7 Enterprise 3.10.10; earlier versions use a fixed limit of 100 headers.

The configuration source depends on how the gateway is deployed:

* Host or Docker
* API7 Gateway Helm

Set the limit in the persistent gateway configuration:

config.yaml

```
apisix:

  max_request_headers_readable: 200  # Default: 100; 0 reads all request headers.
```

Reload or restart every gateway instance after updating `config.yaml`.

With API7 Gateway Helm chart 3.10.19 or later, set the corresponding chart value:

values.yaml

```
apisix:

  maxRequestHeadersReadable: 200  # Default: 100; 0 reads all request headers.
```

Apply the values file through the gateway release's normal Helm upgrade workflow.

The setting only changes the header table visible to plugins. It does not change NGINX parsing limits; headers beyond the plugin-visible limit can still reach the upstream.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* header\_schema

  object

  ***

  Schema for request header.

  At least one of `header_schema` and `body_schema` should be configured.

* body\_schema

  object

  ***

  Schema for request body.

  At least one of `header_schema` and `body_schema` should be configured.

* rejected\_code

  integer

  default: `400`

  valid value:

  between 200 and 599 inclusive

  ***

  Status code to return when rejecting requests.

* rejected\_msg

  string

  ***

  Message to return when rejecting requests.

* max\_req\_body\_size

  integer

  default: `67108864`

  valid value:

  greater than or equal to 1

  ***

  Maximum request body size in bytes read when `body_schema` is configured. A larger body is rejected with `rejected_code`, which defaults to `400`. This field has no effect when only `header_schema` is configured. Introduced in API7 Enterprise 3.9.17 and 3.10.4, and APISIX 3.18.0.
