Class ModelUtils


  • public class ModelUtils
    extends Object
    • Constructor Detail

      • ModelUtils

        public ModelUtils()
    • 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 model
        models - 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)
      • processModelEnums

        public static void processModelEnums​(Map<String,​Object> objs)
      • 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
      • toEnumVarName

        public static String toEnumVarName​(String value)