Class SwaggerUtils


  • public class SwaggerUtils
    extends Object
    Additional operations with rest api spec (swagger).
    • Constructor Detail

      • SwaggerUtils

        public SwaggerUtils()
    • Method Detail

      • getSpec

        public io.swagger.v3.oas.models.OpenAPI getSpec()
        Get swagger spec.
        Returns:
        OpenAPI
      • isSecured

        public Boolean isSecured()
        Swagger server is secured.
        Returns:
        Boolean
      • getHost

        public String getHost()
        Get swagger server host.
        Returns:
        String
      • getValidator

        public com.atlassian.oai.validator.restassured.OpenApiValidationFilter getValidator()
        Get swagger validator.
        Returns:
        OpenApiValidationFilter
      • initialize

        public void initialize​(String path,
                               Integer server)
                        throws MalformedURLException
        Read the swagger spec.
        Parameters:
        path - File path to swagger spec or URI to swagger spec
        server - Server index to which requests will be sent (default: 0)
        Throws:
        MalformedURLException - MalformedURLException
      • getMethod

        public SwaggerMethod getMethod​(String operationId)
        Prepared request and returns the method and base path for the request based on the swagger spec
        Parameters:
        operationId - Operation ID from swagger spec
        Returns:
        SwaggerMethod