Class NodeJSServerCodegen

  • All Implemented Interfaces:
    io.swagger.codegen.v3.CodegenConfig

    public class NodeJSServerCodegen
    extends DefaultCodegenConfig
    • Field Detail

      • implFolder

        protected String implFolder
      • apiVersion

        protected String apiVersion
      • serverPort

        protected int serverPort
      • projectName

        protected String projectName
      • googleCloudFunctions

        protected boolean googleCloudFunctions
      • exportedName

        protected String exportedName
    • Constructor Detail

      • NodeJSServerCodegen

        public NodeJSServerCodegen()
    • Method Detail

      • getTag

        public io.swagger.codegen.v3.CodegenType getTag()
        Configures the type of generator.
        Returns:
        the CodegenType for this generator
        See Also:
        CodegenType
      • getName

        public String getName()
        Configures a friendly name for the generator. This will be used by the generator to select the library with the -l flag.
        Returns:
        the friendly name for the generator
      • getHelp

        public String getHelp()
        Returns human-friendly help for the generator. Provide the consumer with help tips, parameters here
        Returns:
        A string value for the help message
      • toApiName

        public String toApiName​(String name)
        Description copied from class: DefaultCodegenConfig
        Output the API (class) name (capitalized) ending with "Api" Return DefaultApi if name is empty
        Specified by:
        toApiName in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        toApiName in class DefaultCodegenConfig
        Parameters:
        name - the name of the Api
        Returns:
        capitalized Api name ending with "Api"
      • toApiFilename

        public String toApiFilename​(String name)
        Description copied from class: DefaultCodegenConfig
        Return the file name of the Api Test
        Specified by:
        toApiFilename in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        toApiFilename in class DefaultCodegenConfig
        Parameters:
        name - the file name of the Api
        Returns:
        the file name of the Api
      • escapeReservedWord

        public String escapeReservedWord​(String name)
        Escapes a reserved word as defined in the `reservedWords` array. Handle escaping those terms here. This logic is only called if a variable matches the reserved words
        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 term
      • apiFileFolder

        public String apiFileFolder()
        Location to write api files. You can use the apiPackage() as defined when the class is instantiated
        Specified by:
        apiFileFolder in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        apiFileFolder in class DefaultCodegenConfig
      • getGoogleCloudFunctions

        public boolean getGoogleCloudFunctions()
      • setGoogleCloudFunctions

        public void setGoogleCloudFunctions​(boolean value)
      • getExportedName

        public String getExportedName()
      • setExportedName

        public void setExportedName​(String name)
      • processOpts

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

        public void preprocessOpenAPI​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Specified by:
        preprocessOpenAPI in interface io.swagger.codegen.v3.CodegenConfig
        Overrides:
        preprocessOpenAPI in class DefaultCodegenConfig
      • 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
      • 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
      • configuresParameterForMediaType

        protected void configuresParameterForMediaType​(io.swagger.codegen.v3.CodegenOperation codegenOperation,
                                                       List<io.swagger.codegen.v3.CodegenContent> codegenContents)
        Overrides:
        configuresParameterForMediaType in class DefaultCodegenConfig