Class ProcessUtils


  • public class ProcessUtils
    extends Object
    • Constructor Detail

      • ProcessUtils

        public ProcessUtils()
    • Method Detail

      • addIndexToProperties

        public static void addIndexToProperties​(List<ModelMap> models,
                                                int initialIndex)
        Add x-index extension to the model's properties
        Parameters:
        models - List of models
        initialIndex - starting index to use
      • addIndexToProperties

        public static void addIndexToProperties​(List<ModelMap> models)
        Add x-index extension to the model's properties
        Parameters:
        models - List of models
      • hasHttpBasicMethods

        public static boolean hasHttpBasicMethods​(List<CodegenSecurity> authMethods)
        Returns true if the specified OAS model has at least one operation with the HTTP basic security scheme.
        Parameters:
        authMethods - List of auth methods.
        Returns:
        True if at least one operation has HTTP basic security scheme defined
      • getHttpBasicMethods

        public static List<CodegenSecurity> getHttpBasicMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OAS Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OAS Codegen security objects
      • hasApiKeyMethods

        public static boolean hasApiKeyMethods​(List<CodegenSecurity> authMethods)
        Returns true if the specified OAS model has at least one operation with API keys.
        Parameters:
        authMethods - List of auth methods.
        Returns:
        True if at least one operation has API key security scheme defined
      • getApiKeyMethods

        public static List<CodegenSecurity> getApiKeyMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OAS Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OAS Codegen security objects
      • hasHttpSignatureMethods

        public static boolean hasHttpSignatureMethods​(List<CodegenSecurity> authMethods)
        Returns true if the specified OAS model has at least one operation with the HTTP basic security scheme. The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/
        Parameters:
        authMethods - List of auth methods.
        Returns:
        True if at least one operation has HTTP signature security scheme defined
      • getHttpSignatureMethods

        public static List<CodegenSecurity> getHttpSignatureMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OAS Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OAS Codegen security objects
      • hasHttpBearerMethods

        public static boolean hasHttpBearerMethods​(List<CodegenSecurity> authMethods)
        Returns true if the specified OAS model has at least one operation with HTTP bearer.
        Parameters:
        authMethods - List of auth methods.
        Returns:
        True if at least one operation has HTTP bearer security scheme defined
      • getHttpBearerMethods

        public static List<CodegenSecurity> getHttpBearerMethods​(List<CodegenSecurity> authMethods)
        Returns a list of Bearer Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of Bearer Codegen security objects
      • hasOAuthMethods

        public static boolean hasOAuthMethods​(List<CodegenSecurity> authMethods)
        Returns true if the specified OAS model has at least one operation with OAuth.
        Parameters:
        authMethods - List of auth methods.
        Returns:
        True if at least one operation has OAuth security scheme defined
      • getOAuthMethods

        public static List<CodegenSecurity> getOAuthMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OAuth Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OAuth Codegen security objects
      • hasOAuthMethods

        public static boolean hasOAuthMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with OAuth authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has OAuth security scheme defined
      • hasOpenIdConnectMethods

        public static boolean hasOpenIdConnectMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with OpenIdConnect authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has OpenIdConnect security scheme defined
      • getOpenIdConnectMethods

        public static List<CodegenSecurity> getOpenIdConnectMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OpenIdConnect Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OpenIdConnect Codegen security objects
      • hasOpenIdConnectMethods

        public static boolean hasOpenIdConnectMethods​(List<CodegenSecurity> authMethods)
        Returns a list of OpenIdConnect Codegen security objects
        Parameters:
        authMethods - List of auth methods.
        Returns:
        A list of OpenIdConnect Codegen security objects
      • hasHttpBearerMethods

        public static boolean hasHttpBearerMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with HTTP bearer authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has HTTP bearer security scheme defined
      • hasHttpBasicMethods

        public static boolean hasHttpBasicMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with HTTP basic authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has HTTP basic security scheme defined
      • hasHttpSignatureMethods

        public static boolean hasHttpSignatureMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with HTTP signature authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has HTTP signature security scheme defined
      • hasApiKeyMethods

        public static boolean hasApiKeyMethods​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Returns true if the specified OAS model has at least one operation with API key authentication.
        Parameters:
        openAPI - An instance of OpenAPI
        Returns:
        True if at least one operation has API key security scheme defined
      • getSecuritySchemes

        public static Map<String,​io.swagger.v3.oas.models.security.SecurityScheme> getSecuritySchemes​(io.swagger.v3.oas.models.OpenAPI openAPI)