Class OpenapiValidationProperties.Direction
java.lang.Object
ch.nexsol.gateway.validation.OpenapiValidationProperties.Direction
- Enclosing class:
OpenapiValidationProperties
Settings of one direction of the exchange.
Deliberately a plain java bean with no parameterised constructor: a single constructor taking the mode would make Spring Boot, and its configuration metadata processor, read this as a value object bound through that constructor — and every other setting here would silently stop being bindable and stop being offered for completion.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.util.unit.DataSizegetMode()booleanisActive()Returns whether this direction is validated at all.booleanReturns whether a message breaking the contract is rejected.booleanvoidsetMaxBodySize(org.springframework.util.unit.DataSize maxBodySize) voidsetMode(ValidationMode mode) voidsetValidateBody(boolean validateBody)
-
Constructor Details
-
Direction
public Direction()
-
-
Method Details
-
getMode
- Returns:
- what to do with a message that breaks the contract
-
setMode
- Parameters:
mode- what to do with a message that breaks the contract
-
isValidateBody
public boolean isValidateBody()- Returns:
- whether the body is validated
-
setValidateBody
public void setValidateBody(boolean validateBody) - Parameters:
validateBody- whether the body is validated
-
getMaxBodySize
public org.springframework.util.unit.DataSize getMaxBodySize()- Returns:
- the largest body that is buffered to be validated
-
setMaxBodySize
public void setMaxBodySize(org.springframework.util.unit.DataSize maxBodySize) - Parameters:
maxBodySize- the largest body that is buffered to be validated
-
isActive
public boolean isActive()Returns whether this direction is validated at all.- Returns:
trueunless the mode isValidationMode.OFF
-
isEnforced
public boolean isEnforced()Returns whether a message breaking the contract is rejected.- Returns:
truewhen the mode isValidationMode.ENFORCE
-