Class HaskellServantCodegen

    • Constructor Detail

      • HaskellServantCodegen

        public HaskellServantCodegen()
    • 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
      • setBooleanProperty

        public void setBooleanProperty​(String property,
                                       Boolean defaultValue)
      • 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
      • firstLetterToUpper

        public String firstLetterToUpper​(String word)
      • firstLetterToLower

        public String firstLetterToLower​(String word)
      • 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 - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` 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
      • toInstantiationType

        public String toInstantiationType​(io.swagger.v3.oas.models.media.Schema p)
        Description copied from class: DefaultCodegen
        Return the instantiation type of the property, especially for map and array
        Overrides:
        toInstantiationType in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        string presentation of the instantiation type of the property
      • fromOperation

        public CodegenOperation fromOperation​(String resourcePath,
                                              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:
        resourcePath - the path of the operation
        httpMethod - HTTP method
        operation - OAS operation object
        servers - list of servers
        Returns:
        Codegen Operation object
      • fromModel

        public CodegenModel fromModel​(String name,
                                      io.swagger.v3.oas.models.media.Schema mod)
        Description copied from class: DefaultCodegen
        Convert OAS Model object to Codegen Model object.
        Specified by:
        fromModel in interface CodegenConfig
        Overrides:
        fromModel in class DefaultCodegen
        Parameters:
        name - the name of the model
        mod - OAS Model object
        Returns:
        Codegen Model object
      • postProcessFile

        public void postProcessFile​(File file,
                                    String fileType)
        Description copied from class: DefaultCodegen
        Post-process the auto-generated file, e.g. using go-fmt to format the Go code. The file type can be "model-test", "model-doc", "model", "api", "api-test", "api-doc", "supporting-mustache", "supporting-common", "openapi-generator-ignore", "openapi-generator-version"

        TODO: store these values in enum instead

        Specified by:
        postProcessFile in interface CodegenConfig
        Overrides:
        postProcessFile in class DefaultCodegen
        Parameters:
        file - file to be processed
        fileType - file type