public class OpenApiValidationService extends Object
| Constructor and Description |
|---|
OpenApiValidationService(org.springframework.core.io.support.EncodedResource specAsResource,
org.springframework.web.util.UrlPathHelper urlPathHelper) |
OpenApiValidationService(OpenApiInteractionValidator validator,
org.springframework.web.util.UrlPathHelper urlPathHelper) |
| Modifier and Type | Method and Description |
|---|---|
Request |
buildRequest(javax.servlet.http.HttpServletRequest servletRequest) |
Response |
buildResponse(org.springframework.web.util.ContentCachingResponseWrapper servletResponse) |
ValidationReport |
validateRequest(Request request) |
ValidationReport |
validateResponse(javax.servlet.http.HttpServletRequest servletRequest,
Response response) |
public OpenApiValidationService(org.springframework.core.io.support.EncodedResource specAsResource,
org.springframework.web.util.UrlPathHelper urlPathHelper)
throws IOException
IOExceptionpublic OpenApiValidationService(OpenApiInteractionValidator validator, org.springframework.web.util.UrlPathHelper urlPathHelper)
public Request buildRequest(javax.servlet.http.HttpServletRequest servletRequest) throws IOException
servletRequest - the HttpServletRequestRequest created out of given HttpServletRequestIOException - if the request body can't be readpublic Response buildResponse(org.springframework.web.util.ContentCachingResponseWrapper servletResponse)
servletResponse - the HttpServletResponse whose body is cachedResponse created out of given ContentCachingResponseWrapperpublic ValidationReport validateRequest(Request request)
request - the Request to validate against the OpenAPI / Swagger specificationValidationReport for the validated Requestpublic ValidationReport validateResponse(javax.servlet.http.HttpServletRequest servletRequest, Response response)
servletRequest - the HttpServletRequest to examine the api path to validate againstresponse - the Response to validate against the OpenAPI / Swagger specificationValidationReport for the validated RequestCopyright © 2016–2022 Atlassian. All rights reserved.