Package org.openapitools.codegen.utils
Class ProcessUtils
- java.lang.Object
-
- org.openapitools.codegen.utils.ProcessUtils
-
public class ProcessUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ProcessUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddIndexToProperties(List<ModelMap> models)Add x-index extension to the model's propertiesstatic voidaddIndexToProperties(List<ModelMap> models, int initialIndex)Add x-index extension to the model's propertiesstatic List<CodegenSecurity>getApiKeyMethods(List<CodegenSecurity> authMethods)Returns a list of OAS Codegen security objectsstatic List<CodegenSecurity>getHttpBasicMethods(List<CodegenSecurity> authMethods)Returns a list of OAS Codegen security objectsstatic List<CodegenSecurity>getHttpBearerMethods(List<CodegenSecurity> authMethods)Returns a list of Bearer Codegen security objectsstatic List<CodegenSecurity>getHttpSignatureMethods(List<CodegenSecurity> authMethods)Returns a list of OAS Codegen security objectsstatic List<CodegenSecurity>getOAuthMethods(List<CodegenSecurity> authMethods)Returns a list of OAuth Codegen security objectsstatic List<CodegenSecurity>getOpenIdConnectMethods(List<CodegenSecurity> authMethods)Returns a list of OpenIdConnect Codegen security objectsstatic Map<String,io.swagger.v3.oas.models.security.SecurityScheme>getSecuritySchemes(io.swagger.v3.oas.models.OpenAPI openAPI)static booleanhasApiKeyMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with API key authentication.static booleanhasApiKeyMethods(List<CodegenSecurity> authMethods)Returns true if the specified OAS model has at least one operation with API keys.static booleanhasHttpBasicMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with HTTP basic authentication.static booleanhasHttpBasicMethods(List<CodegenSecurity> authMethods)Returns true if the specified OAS model has at least one operation with the HTTP basic security scheme.static booleanhasHttpBearerMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with HTTP bearer authentication.static booleanhasHttpBearerMethods(List<CodegenSecurity> authMethods)Returns true if the specified OAS model has at least one operation with HTTP bearer.static booleanhasHttpSignatureMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with HTTP signature authentication.static booleanhasHttpSignatureMethods(List<CodegenSecurity> authMethods)Returns true if the specified OAS model has at least one operation with the HTTP basic security scheme.static booleanhasOAuthMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with OAuth authentication.static booleanhasOAuthMethods(List<CodegenSecurity> authMethods)Returns true if the specified OAS model has at least one operation with OAuth.static booleanhasOpenIdConnectMethods(io.swagger.v3.oas.models.OpenAPI openAPI)Returns true if the specified OAS model has at least one operation with OpenIdConnect authentication.static booleanhasOpenIdConnectMethods(List<CodegenSecurity> authMethods)Returns a list of OpenIdConnect Codegen security objects
-
-
-
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 modelsinitialIndex- 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
-
-