Class NodeJSServerCodegen

java.lang.Object
io.swagger.codegen.v3.generators.DefaultCodegenConfig
io.swagger.codegen.v3.generators.nodejs.NodeJSServerCodegen
All Implemented Interfaces:
io.swagger.codegen.v3.CodegenConfig

public class NodeJSServerCodegen extends DefaultCodegenConfig
  • Field Details

    • implFolder

      protected String implFolder
    • GOOGLE_CLOUD_FUNCTIONS

      public static final String GOOGLE_CLOUD_FUNCTIONS
      See Also:
    • EXPORTED_NAME

      public static final String EXPORTED_NAME
      See Also:
    • apiVersion

      protected String apiVersion
    • serverPort

      protected int serverPort
    • projectName

      protected String projectName
    • googleCloudFunctions

      protected boolean googleCloudFunctions
    • exportedName

      protected String exportedName
  • Constructor Details

    • NodeJSServerCodegen

      public NodeJSServerCodegen()
  • Method Details

    • apiPackage

      public String apiPackage()
      Specified by:
      apiPackage in interface io.swagger.codegen.v3.CodegenConfig
      Overrides:
      apiPackage in class DefaultCodegenConfig
    • 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
    • apiFilename

      public String apiFilename(String templateName, String tag)
      Specified by:
      apiFilename in interface io.swagger.codegen.v3.CodegenConfig
      Overrides:
      apiFilename in class DefaultCodegenConfig
    • getDefaultTemplateDir

      public String getDefaultTemplateDir()
      Specified by:
      getDefaultTemplateDir in class DefaultCodegenConfig
    • 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)
    • postProcessOperations

      public Map<String,Object> postProcessOperations(Map<String,Object> objs)
      Specified by:
      postProcessOperations in interface io.swagger.codegen.v3.CodegenConfig
      Overrides:
      postProcessOperations in class DefaultCodegenConfig
    • 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
    • postProcessSupportingFileData

      public Map<String,Object> postProcessSupportingFileData(Map<String,Object> objs)
      Specified by:
      postProcessSupportingFileData in interface io.swagger.codegen.v3.CodegenConfig
      Overrides:
      postProcessSupportingFileData in class DefaultCodegenConfig
    • removeNonNameElementToCamelCase

      public String removeNonNameElementToCamelCase(String name)
      Description copied from class: DefaultCodegenConfig
      Remove characters not suitable for variable or method name from the input and camelize it
      Overrides:
      removeNonNameElementToCamelCase in class DefaultCodegenConfig
      Parameters:
      name - string to be camelize
      Returns:
      camelized string
    • 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