public static class BodyValidationRequestPolicy.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
BodyValidationRequestPolicy |
build() |
BodyValidationRequestPolicy.Builder |
content(Map<String,ContentValidation> content)
The content of the request body.
|
BodyValidationRequestPolicy.Builder |
copy(BodyValidationRequestPolicy model) |
BodyValidationRequestPolicy.Builder |
required(Boolean required)
Determines if the request body is required in the request.
|
BodyValidationRequestPolicy.Builder |
validationMode(BodyValidationRequestPolicy.ValidationMode validationMode)
Validation behavior mode.
|
public BodyValidationRequestPolicy.Builder required(Boolean required)
Determines if the request body is required in the request.
required
- the value to setpublic BodyValidationRequestPolicy.Builder content(Map<String,ContentValidation> content)
The content of the request body. The key is a media type range subset restricted to the following schema
key ::= ( / ( "*" "/" "*" ) / ( type "/" "*" ) / ( type "/" subtype ) )
For requests that match multiple keys, only the most specific key is applicable. e.g.
text/plain
overrides text/*
content
- the value to setpublic BodyValidationRequestPolicy.Builder validationMode(BodyValidationRequestPolicy.ValidationMode validationMode)
Validation behavior mode.
In ENFORCING
mode, upon a validation failure, the request will be rejected
with a 4xx response and not sent to the backend.
In PERMISSIVE
mode, the result of the validation will be exposed as metrics
while the request will follow the normal path.
DISABLED
type turns the validation off.
validationMode
- the value to setpublic BodyValidationRequestPolicy build()
public BodyValidationRequestPolicy.Builder copy(BodyValidationRequestPolicy model)
Copyright © 2016–2024. All rights reserved.