Class SwaggerMatchers

java.lang.Object
com.atlassian.oai.validator.mockmvc.SwaggerMatchers

@Deprecated public class SwaggerMatchers extends Object
Deprecated.
Replaced with OpenApiMatchers
Factory for OpenAPI / Swagger assertions.
  • Constructor Details

    • SwaggerMatchers

      public SwaggerMatchers()
      Deprecated.
  • Method Details

    • isValid

      public org.springframework.test.web.servlet.ResultMatcher isValid(String specUrlOrPayload)
      Deprecated.
      Assert the result can be validated against the given Swagger v2 or OpenAPI v3 specification.

      The specification can be provided as a URL or an inline spec in JSON or YAML format.

      A 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
           .isValid("http://api.myservice.com/swagger.json")
      
           // Create from a file on the local filesystem
           .isValid("file://Users/myuser/tmp/api.yaml");
      
           // Create from a classpath resource in the /api package
           .isValid("/api/swagger.json");
      
           // Create from a swagger JSON payload
           .isValid("{\"swagger\": \"2.0\", ...}")
       
      Parameters:
      specUrlOrPayload - The location of the Swagger JSON specification to use in the validator.