Class ResponseValidator

java.lang.Object
com.atlassian.oai.validator.interaction.response.ResponseValidator

public class ResponseValidator extends Object
Validate a response against an 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 bodies
      messages - The message resolver to use
      api - The OpenAPI spec to validate against
      customResponseValidators - The list of custom validators to run
  • Method Details

    • validateResponse

      @Nonnull public ValidationReport validateResponse(Response response, ApiOperation apiOperation)
      Validate the given response against the API operation.
      Parameters:
      response - The response to validate
      apiOperation - The API operation to validate the response against
      Returns:
      A validation report containing validation errors