Class RequestValidator
java.lang.Object
com.atlassian.oai.validator.interaction.request.RequestValidator
Validate a request against a given API operation.
-
Constructor Summary
ConstructorsConstructorDescriptionRequestValidator(SchemaValidator schemaValidator, MessageResolver messages, io.swagger.v3.oas.models.OpenAPI api, List<CustomRequestValidator> customRequestValidators) Construct a new request validator with the given schema validator. -
Method Summary
Modifier and TypeMethodDescriptionvalidateRequest(Request request, ApiOperation apiOperation) Validate the request against the given API operation
-
Constructor Details
-
RequestValidator
public RequestValidator(SchemaValidator schemaValidator, MessageResolver messages, io.swagger.v3.oas.models.OpenAPI api, List<CustomRequestValidator> customRequestValidators) Construct a new request validator with the given schema validator.- Parameters:
schemaValidator- The schema validator to use when validating request bodiesmessages- The message resolver to useapi- The OpenAPI spec to validate againstcustomRequestValidators- The list of custom validators to run
-
-
Method Details
-
validateRequest
Validate the request against the given API operation- Parameters:
request- The request to validateapiOperation- The operation to validate the request against- Returns:
- A validation report containing validation errors
-