Class OpenApiValidationService
java.lang.Object
com.atlassian.oai.validator.springmvc.OpenApiValidationService
-
Constructor Summary
ConstructorsConstructorDescriptionOpenApiValidationService(OpenApiInteractionValidator validator, org.springframework.web.util.UrlPathHelper urlPathHelper) OpenApiValidationService(org.springframework.core.io.support.EncodedResource specAsResource, org.springframework.web.util.UrlPathHelper urlPathHelper) -
Method Summary
Modifier and TypeMethodDescriptionbuildRequest(javax.servlet.http.HttpServletRequest servletRequest, Supplier<Body> bodySupplier) buildResponse(org.springframework.web.util.ContentCachingResponseWrapper servletResponse) validateRequest(Request request) validateResponse(javax.servlet.http.HttpServletRequest servletRequest, Response response)
-
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
-
buildResponse
public Response buildResponse(org.springframework.web.util.ContentCachingResponseWrapper servletResponse) - Parameters:
servletResponse- theHttpServletResponsewhose body is cached- Returns:
- the build
Responsecreated out of givenContentCachingResponseWrapper
-
validateRequest
- Parameters:
request- theRequestto validate against the OpenAPI / Swagger specification- Returns:
- the
ValidationReportfor the validatedRequest
-
validateResponse
public ValidationReport validateResponse(javax.servlet.http.HttpServletRequest servletRequest, Response response) - Parameters:
servletRequest- theHttpServletRequestto examine the api path to validate againstresponse- theResponseto validate against the OpenAPI / Swagger specification- Returns:
- the
ValidationReportfor the validatedRequest
-