BodyValidationRequestPolicy

class oci.apigateway.models.BodyValidationRequestPolicy(**kwargs)

Bases: object

Validate the payload body of the incoming API requests on a specific route.

Attributes

VALIDATION_MODE_DISABLED A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy.
VALIDATION_MODE_ENFORCING A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy.
VALIDATION_MODE_PERMISSIVE A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy.
content [Required] Gets the content of this BodyValidationRequestPolicy.
required Gets the required of this BodyValidationRequestPolicy.
validation_mode Gets the validation_mode of this BodyValidationRequestPolicy.

Methods

__init__(**kwargs) Initializes a new BodyValidationRequestPolicy object with values from keyword arguments.
VALIDATION_MODE_DISABLED = 'DISABLED'

A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy. This constant has a value of “DISABLED”

VALIDATION_MODE_ENFORCING = 'ENFORCING'

A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy. This constant has a value of “ENFORCING”

VALIDATION_MODE_PERMISSIVE = 'PERMISSIVE'

A constant which can be used with the validation_mode property of a BodyValidationRequestPolicy. This constant has a value of “PERMISSIVE”

__init__(**kwargs)

Initializes a new BodyValidationRequestPolicy object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • required (bool) – The value to assign to the required property of this BodyValidationRequestPolicy.
  • content (dict(str, ContentValidation)) – The value to assign to the content property of this BodyValidationRequestPolicy.
  • validation_mode (str) – The value to assign to the validation_mode property of this BodyValidationRequestPolicy. Allowed values for this property are: “ENFORCING”, “PERMISSIVE”, “DISABLED”
content

[Required] Gets the content of this BodyValidationRequestPolicy. 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/*

Returns:The content of this BodyValidationRequestPolicy.
Return type:dict(str, ContentValidation)
required

Gets the required of this BodyValidationRequestPolicy. Determines if the request body is required in the request.

Returns:The required of this BodyValidationRequestPolicy.
Return type:bool
validation_mode

Gets the validation_mode of this BodyValidationRequestPolicy. 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.

Allowed values for this property are: “ENFORCING”, “PERMISSIVE”, “DISABLED”

Returns:The validation_mode of this BodyValidationRequestPolicy.
Return type:str