Class AbstractTypeScriptClientCodegen

    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • modelPropertyNaming

        protected String modelPropertyNaming
      • supportsES6

        protected Boolean supportsES6
      • languageGenericTypes

        protected HashSet<String> languageGenericTypes
    • Constructor Detail

      • AbstractTypeScriptClientCodegen

        public AbstractTypeScriptClientCodegen()
    • Method Detail

      • processOpts

        public void processOpts()
        Specified by:
        processOpts in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        processOpts in class DefaultCodegenConfig
      • getTag

        public io.swagger.codegen.v3.CodegenType getTag()
      • escapeReservedWord

        public String escapeReservedWord​(String name)
        Description copied from class: DefaultCodegenConfig
        Return the escaped name of the reserved word
        Specified by:
        escapeReservedWord in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        escapeReservedWord in class DefaultCodegenConfig
        Parameters:
        name - the name to be escaped
        Returns:
        the escaped reserved word throws Runtime exception as reserved word is not allowed (default behavior)
      • toParamName

        public String toParamName​(String name)
        Description copied from class: DefaultCodegenConfig
        Return the parameter name by removing invalid characters and proper escaping if it's a reserved word.
        Specified by:
        toParamName in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        toParamName in class DefaultCodegenConfig
        Parameters:
        name - Codegen property object
        Returns:
        the sanitized parameter name
      • toVarName

        public String toVarName​(String name)
        Description copied from class: DefaultCodegenConfig
        Return the variable name by removing invalid characters and proper escaping if it's a reserved word.
        Overrides:
        toVarName in class DefaultCodegenConfig
        Parameters:
        name - the variable name
        Returns:
        the sanitized variable name
      • toModelName

        public String toModelName​(String name)
        Description copied from class: DefaultCodegenConfig
        Output the proper model name (capitalized). In case the name belongs to the TypeSystem it won't be renamed.
        Specified by:
        toModelName in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        toModelName in class DefaultCodegenConfig
        Parameters:
        name - the name of the model
        Returns:
        capitalized model name
      • toModelFilename

        public String toModelFilename​(String name)
        Description copied from class: DefaultCodegenConfig
        Return the capitalized file name of the model
        Specified by:
        toModelFilename in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        toModelFilename in class DefaultCodegenConfig
        Parameters:
        name - the model name
        Returns:
        the file name of the model
      • fromModel

        public io.swagger.codegen.v3.CodegenModel fromModel​(String name,
                                                            io.swagger.v3.oas.models.media.Schema schema,
                                                            Map<String,​io.swagger.v3.oas.models.media.Schema> allDefinitions)
        Description copied from class: DefaultCodegenConfig
        Convert Swagger Model object to Codegen Model object
        Specified by:
        fromModel in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        fromModel in class DefaultCodegenConfig
        Parameters:
        name - the name of the model
        schema - Swagger Model object
        allDefinitions - a map of all Swagger models from the spec
        Returns:
        Codegen Model object
      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.v3.oas.models.media.Schema propertySchema)
        Description copied from class: DefaultCodegenConfig
        Output the type declaration of the property
        Specified by:
        getTypeDeclaration in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        getTypeDeclaration in class DefaultCodegenConfig
        Parameters:
        propertySchema - Schema Property object
        Returns:
        a string presentation of the property type
      • toDefaultValue

        public String toDefaultValue​(io.swagger.v3.oas.models.media.Schema propertySchema)
        Description copied from class: DefaultCodegenConfig
        Return the default value of the property
        Overrides:
        toDefaultValue in class DefaultCodegenConfig
        Parameters:
        propertySchema - Schema property object
        Returns:
        string presentation of the default value of the property
      • getSchemaType

        public String getSchemaType​(io.swagger.v3.oas.models.media.Schema schema)
        Description copied from class: DefaultCodegenConfig
        returns the swagger type for the property
        Overrides:
        getSchemaType in class DefaultCodegenConfig
        Parameters:
        schema - Schema property object
        Returns:
        string presentation of the type
      • setModelPropertyNaming

        public void setModelPropertyNaming​(String naming)
      • getModelPropertyNaming

        public String getModelPropertyNaming()
      • getNameUsingModelPropertyNaming

        public String getNameUsingModelPropertyNaming​(String name)
      • toEnumValue

        public String toEnumValue​(String value,
                                  String datatype)
        Description copied from class: DefaultCodegenConfig
        Return the enum value in the language specified format e.g. status becomes "status"
        Overrides:
        toEnumValue in class DefaultCodegenConfig
        Parameters:
        value - enum variable name
        datatype - data type
        Returns:
        the sanitized value for enum
      • toEnumName

        public String toEnumName​(io.swagger.codegen.v3.CodegenProperty property)
        Description copied from class: DefaultCodegenConfig
        Return the Enum name (e.g. StatusEnum given 'status')
        Overrides:
        toEnumName in class DefaultCodegenConfig
        Parameters:
        property - Codegen property
        Returns:
        the Enum name
      • setSupportsES6

        public void setSupportsES6​(Boolean value)
      • getSupportsES6

        public Boolean getSupportsES6()
      • escapeQuotationMark

        public String escapeQuotationMark​(String input)
        Description copied from class: DefaultCodegenConfig
        Escape single and/or double quote to avoid code injection
        Specified by:
        escapeQuotationMark in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        escapeQuotationMark in class DefaultCodegenConfig
        Parameters:
        input - String to be cleaned up
        Returns:
        string with quotation mark removed or escaped
      • escapeUnsafeCharacters

        public String escapeUnsafeCharacters​(String input)
        Description copied from class: DefaultCodegenConfig
        override with any special text escaping logic to handle unsafe characters so as to avoid code injection
        Specified by:
        escapeUnsafeCharacters in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        escapeUnsafeCharacters in class DefaultCodegenConfig
        Parameters:
        input - String to be cleaned up
        Returns:
        string with unsafe characters removed or escaped
      • getSchemaHandler

        public io.swagger.codegen.v3.ISchemaHandler getSchemaHandler()
        Specified by:
        getSchemaHandler in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        getSchemaHandler in class DefaultCodegenConfig