Class ResponseValidator
java.lang.Object
com.atlassian.oai.validator.interaction.response.ResponseValidator
Validate a response against an API operation
-
Constructor Summary
ConstructorsConstructorDescriptionResponseValidator(SchemaValidator schemaValidator, MessageResolver messages, io.swagger.v3.oas.models.OpenAPI api, List<CustomResponseValidator> customResponseValidators) Construct a new response validator with the given schema validator. -
Method Summary
Modifier and TypeMethodDescriptionvalidateResponse(Response response, ApiOperation apiOperation) Validate the given response against the API operation.
-
Constructor Details
-
ResponseValidator
public ResponseValidator(SchemaValidator schemaValidator, MessageResolver messages, io.swagger.v3.oas.models.OpenAPI api, List<CustomResponseValidator> customResponseValidators) Construct a new response validator with the given schema validator.- Parameters:
schemaValidator- The schema validator to use when validating response bodiesmessages- The message resolver to useapi- The OpenAPI spec to validate againstcustomResponseValidators- The list of custom validators to run
-
-
Method Details
-
validateResponse
Validate the given response against the API operation.- Parameters:
response- The response to validateapiOperation- The API operation to validate the response against- Returns:
- A validation report containing validation errors
-