public class SwaggerMatchers extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SwaggerMatchers.SwaggerValidationException |
| Constructor and Description |
|---|
SwaggerMatchers() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.test.web.servlet.ResultMatcher |
isValid(String swaggerJsonUrlOrPayload)
Assert the result can be validated against the Swagger JSON specification at the given location OR actual swagger JSON String payload.
|
public org.springframework.test.web.servlet.ResultMatcher isValid(String swaggerJsonUrlOrPayload)
The URL can be an absolute HTTP/HTTPS URL, a File URL or a classpath location (without the classpath: scheme).
For example:
// Create from a publicly hosted HTTP location
.createFor("http://api.myservice.com/swagger.json")
// Create from a file on the local filesystem
.createFor("file://Users/myuser/tmp/swagger.json");
// Create from a classpath resource in the /api package
.createFor("/api/swagger.json");
// Create from a swagger JSON payload
.createFor("{\"swagger\": \"2.0\", ...}")
swaggerJsonUrlOrPayload - The location of the Swagger JSON specification to use in the validator.Copyright © 2016–2018 Atlassian. All rights reserved.