Class OpenApiValidationService

java.lang.Object
com.atlassian.oai.validator.springmvc.OpenApiValidationService

public class OpenApiValidationService extends Object
  • Constructor Details

    • OpenApiValidationService

      public OpenApiValidationService(org.springframework.core.io.support.EncodedResource specAsResource, org.springframework.web.util.UrlPathHelper urlPathHelper) throws IOException
      Throws:
      IOException
    • OpenApiValidationService

      public OpenApiValidationService(OpenApiInteractionValidator validator, org.springframework.web.util.UrlPathHelper urlPathHelper)
  • Method Details

    • buildRequest

      public Request buildRequest(javax.servlet.http.HttpServletRequest servletRequest, Supplier<Body> bodySupplier)
      Parameters:
      servletRequest - the HttpServletRequest
      bodySupplier - the Supplier of a Body for the request validation
      Returns:
      the build Request created out of given HttpServletRequest
    • buildResponse

      public Response buildResponse(org.springframework.web.util.ContentCachingResponseWrapper servletResponse)
      Parameters:
      servletResponse - the HttpServletResponse whose body is cached
      Returns:
      the build Response created out of given ContentCachingResponseWrapper
    • validateRequest

      public ValidationReport validateRequest(Request request)
      Parameters:
      request - the Request to validate against the OpenAPI / Swagger specification
      Returns:
      the ValidationReport for the validated Request
    • validateResponse

      public ValidationReport validateResponse(javax.servlet.http.HttpServletRequest servletRequest, Response response)
      Parameters:
      servletRequest - the HttpServletRequest to examine the api path to validate against
      response - the Response to validate against the OpenAPI / Swagger specification
      Returns:
      the ValidationReport for the validated Request