Class BashClientCodegen

    • Field Detail

      • apiVersion

        protected String apiVersion
      • curlOptions

        protected String curlOptions
      • processMarkdown

        protected boolean processMarkdown
      • scriptName

        protected String scriptName
      • generateBashCompletion

        protected boolean generateBashCompletion
      • generateZshCompletion

        protected boolean generateZshCompletion
      • hostEnvironmentVariable

        protected String hostEnvironmentVariable
      • basicAuthEnvironmentVariable

        protected String basicAuthEnvironmentVariable
      • apiKeyAuthEnvironmentVariable

        protected String apiKeyAuthEnvironmentVariable
      • apiDocPath

        protected String apiDocPath
      • modelDocPath

        protected String modelDocPath
      • emptyMethodNameCounter

        protected static int emptyMethodNameCounter
      • BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME

        public static final String BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME
        See Also:
        Constant Field Values
      • APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME

        public static final String APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • BashClientCodegen

        public BashClientCodegen()
    • Method Detail

      • getName

        public String getName()
        Configures a friendly name for the generator. This will be used by the generator to select the library with the -g flag.
        Specified by:
        getName in interface CodegenConfig
        Overrides:
        getName in class DefaultCodegen
        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
        Specified by:
        getHelp in interface CodegenConfig
        Overrides:
        getHelp in class DefaultCodegen
        Returns:
        A string value for the help message
      • setCurlOptions

        public void setCurlOptions​(String curlOptions)
      • setProcessMarkdown

        public void setProcessMarkdown​(boolean processMarkdown)
      • setScriptName

        public void setScriptName​(String scriptName)
      • setGenerateBashCompletion

        public void setGenerateBashCompletion​(boolean generateBashCompletion)
      • setGenerateZshCompletion

        public void setGenerateZshCompletion​(boolean generateZshCompletion)
      • setHostEnvironmentVariable

        public void setHostEnvironmentVariable​(String hostEnvironmentVariable)
      • setBasicAuthEnvironmentVariable

        public void setBasicAuthEnvironmentVariable​(String basicAuthEnvironmentVariable)
      • setApiKeyAuthEnvironmentVariable

        public void setApiKeyAuthEnvironmentVariable​(String apiKeyAuthEnvironmentVariable)
      • 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 CodegenConfig
        Overrides:
        escapeReservedWord in class DefaultCodegen
        Parameters:
        name - the name to be escaped
        Returns:
        the escaped term
      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.v3.oas.models.media.Schema p)
        Optional - type declaration. This is a String which is used by the templates to instantiate your types. There is typically special handling for different property types
        Specified by:
        getTypeDeclaration in interface CodegenConfig
        Overrides:
        getTypeDeclaration in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        a string value used as the `dataType` field for model templates, `returnType` for api templates
      • getSchemaType

        public String getSchemaType​(io.swagger.v3.oas.models.media.Schema p)
        Optional - schema type conversion. This is used to map OpenAPI types in a `Property` into either language specific types via `typeMapping` or into complex models if there is not a mapping.
        Overrides:
        getSchemaType in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        a string value of the type or complex model for this property
        See Also:
        Schema
      • fromParameter

        public CodegenParameter fromParameter​(io.swagger.v3.oas.models.parameters.Parameter param,
                                              Set<String> imports)
        Convert OpenAPI Parameter object to Codegen Parameter object
        Overrides:
        fromParameter in class DefaultCodegen
        Parameters:
        imports - set of imports for library/package/module
        param - OpenAPI parameter object
        Returns:
        Codegen Parameter object
      • fromOperation

        public CodegenOperation fromOperation​(String path,
                                              String httpMethod,
                                              io.swagger.v3.oas.models.Operation operation,
                                              List<io.swagger.v3.oas.models.servers.Server> servers)
        Description copied from class: DefaultCodegen
        Convert OAS Operation object to Codegen Operation object
        Specified by:
        fromOperation in interface CodegenConfig
        Overrides:
        fromOperation in class DefaultCodegen
        Parameters:
        path - the path of the operation
        httpMethod - HTTP method
        operation - OAS operation object
        servers - list of servers
        Returns:
        Codegen Operation object
      • preprocessOpenAPI

        public void preprocessOpenAPI​(io.swagger.v3.oas.models.OpenAPI openAPI)
        Preprocess original properties from the OpenAPI definition where necessary.
        Specified by:
        preprocessOpenAPI in interface CodegenConfig
        Overrides:
        preprocessOpenAPI in class DefaultCodegen
        Parameters:
        openAPI - [description]
      • toOperationId

        public String toOperationId​(String operationId)
        Description copied from class: DefaultCodegen
        Return the operation ID (method name)
        Overrides:
        toOperationId in class DefaultCodegen
        Parameters:
        operationId - operation ID
        Returns:
        the sanitized method name