Package io.swagger.codegen.v3.utils
Class ModelUtils
- java.lang.Object
-
- io.swagger.codegen.v3.utils.ModelUtils
-
public class ModelUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ModelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.swagger.v3.oas.models.Operation[]createOperationArray(io.swagger.v3.oas.models.PathItem pathItem)static StringfindCommonPrefixOfVars(List<Object> vars)Returns the common prefix of variables for enum namingstatic CodegenModelgetModelByName(String name, Map<String,Object> models)Searches for the model by name in the map of models and returns itstatic voidprocessCodegenModels(Map<String,CodegenModel> allModels)static voidprocessModelEnums(Map<String,Object> objs)static StringtoEnumVarName(String value)static voidupdateCodegenPropertyEnum(CodegenProperty var)Update codegen property's enum by adding "enumVars" (with name and value)
-
-
-
Method Detail
-
getModelByName
public static CodegenModel getModelByName(String name, Map<String,Object> models)
Searches for the model by name in the map of models and returns it- Parameters:
name- Name of the modelmodels- Map of models- Returns:
- model
-
createOperationArray
public static io.swagger.v3.oas.models.Operation[] createOperationArray(io.swagger.v3.oas.models.PathItem pathItem)
-
processCodegenModels
public static void processCodegenModels(Map<String,CodegenModel> allModels)
-
findCommonPrefixOfVars
public static String findCommonPrefixOfVars(List<Object> vars)
Returns the common prefix of variables for enum naming- Parameters:
vars- List of variable names- Returns:
- the common prefix for naming
-
updateCodegenPropertyEnum
public static void updateCodegenPropertyEnum(CodegenProperty var)
Update codegen property's enum by adding "enumVars" (with name and value)- Parameters:
var- list of CodegenProperty
-
-