Class AbstractFSharpCodegen

    • Field Detail

      • optionalAssemblyInfoFlag

        protected boolean optionalAssemblyInfoFlag
      • optionalProjectFileFlag

        protected boolean optionalProjectFileFlag
      • useDateTimeOffsetFlag

        protected boolean useDateTimeOffsetFlag
      • useCollection

        protected boolean useCollection
      • returnICollection

        protected boolean returnICollection
      • netCoreProjectFileFlag

        protected boolean netCoreProjectFileFlag
      • modelPropertyNaming

        protected String modelPropertyNaming
      • licenseUrl

        protected String licenseUrl
      • licenseName

        protected String licenseName
      • packageVersion

        protected String packageVersion
      • packageName

        protected String packageName
      • packageTitle

        protected String packageTitle
      • packageProductName

        protected String packageProductName
      • packageDescription

        protected String packageDescription
      • packageCompany

        protected String packageCompany
      • packageCopyright

        protected String packageCopyright
      • packageAuthors

        protected String packageAuthors
      • interfacePrefix

        protected String interfacePrefix
      • projectFolder

        protected String projectFolder
      • sourceFolder

        protected String sourceFolder
      • testFolder

        protected String testFolder
      • collectionTypes

        protected Set<String> collectionTypes
      • supportNullable

        protected boolean supportNullable
      • nullableType

        protected Set<String> nullableType
    • Constructor Detail

      • AbstractFSharpCodegen

        public AbstractFSharpCodegen()
    • Method Detail

      • setReturnICollection

        public void setReturnICollection​(boolean returnICollection)
      • setUseCollection

        public void setUseCollection​(boolean useCollection)
      • setNetCoreProjectFileFlag

        public void setNetCoreProjectFileFlag​(boolean flag)
      • useDateTimeOffset

        public void useDateTimeOffset​(boolean flag)
      • addMustacheLambdas

        protected com.google.common.collect.ImmutableMap.Builder<String,​com.samskivert.mustache.Mustache.Lambda> addMustacheLambdas()
        Description copied from class: DefaultCodegen
        Preset map builder with commonly used Mustache lambdas. To extend the map, override addMustacheLambdas(), call parent method first and then add additional lambdas to the returned builder. If common lambdas are not desired, override addMustacheLambdas() method and return empty builder.
        Overrides:
        addMustacheLambdas in class DefaultCodegen
        Returns:
        preinitialized map with common lambdas
      • updateCodegenPropertyEnum

        public void updateCodegenPropertyEnum​(CodegenProperty var)
        Update codegen property's enum by adding "enumVars" (with name and value)
        Overrides:
        updateCodegenPropertyEnum in class DefaultCodegen
        Parameters:
        var - list of CodegenProperty
      • processOperation

        protected void processOperation​(CodegenOperation operation)
      • 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
      • getModelPropertyNaming

        public String getModelPropertyNaming()
      • setModelPropertyNaming

        public void setModelPropertyNaming​(String naming)
      • getNameUsingModelPropertyNaming

        public String getNameUsingModelPropertyNaming​(String name)
      • toVarName

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

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

        public String toExampleValue​(io.swagger.v3.oas.models.media.Schema p)
        Return the example value of the property
        Overrides:
        toExampleValue in class DefaultCodegen
        Parameters:
        p - OpenAPI property object
        Returns:
        string presentation of the example value of the property
      • toDefaultValue

        public String toDefaultValue​(io.swagger.v3.oas.models.media.Schema p)
        Return the default value of the property
        Overrides:
        toDefaultValue in class DefaultCodegen
        Parameters:
        p - OpenAPI property object
        Returns:
        string presentation of the default value of the property
      • getNullableType

        public String getNullableType​(io.swagger.v3.oas.models.media.Schema p,
                                      String type)
      • getSchemaType

        public String getSchemaType​(io.swagger.v3.oas.models.media.Schema p)
        Description copied from class: DefaultCodegen
        returns the OpenAPI type for the property. Use getAlias to handle $ref of primitive type
        Overrides:
        getSchemaType in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        string presentation of the type
      • 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
      • toModelName

        public String toModelName​(String name)
        Description copied from class: DefaultCodegen
        Converts the OpenAPI schema name to a model name suitable for the current code generator. May be overridden for each programming language. In case the name belongs to the TypeSystem it won't be renamed.
        Specified by:
        toModelName in interface CodegenConfig
        Overrides:
        toModelName in class DefaultCodegen
        Parameters:
        name - the name of the model
        Returns:
        capitalized model name
      • setLicenseUrl

        public void setLicenseUrl​(String licenseUrl)
      • setLicenseName

        public void setLicenseName​(String licenseName)
      • setPackageName

        public void setPackageName​(String packageName)
      • setPackageVersion

        public void setPackageVersion​(String packageVersion)
      • setPackageTitle

        public void setPackageTitle​(String packageTitle)
      • setPackageProductName

        public void setPackageProductName​(String packageProductName)
      • setPackageDescription

        public void setPackageDescription​(String packageDescription)
      • setPackageCompany

        public void setPackageCompany​(String packageCompany)
      • setPackageCopyright

        public void setPackageCopyright​(String packageCopyright)
      • setPackageAuthors

        public void setPackageAuthors​(String packageAuthors)
      • setSourceFolder

        public void setSourceFolder​(String sourceFolder)
      • getInterfacePrefix

        public String getInterfacePrefix()
      • setInterfacePrefix

        public void setInterfacePrefix​(String interfacePrefix)
      • isSupportNullable

        public boolean isSupportNullable()
      • setSupportNullable

        public void setSupportNullable​(boolean supportNullable)
      • toEnumValue

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

        public String toEnumVarName​(String name,
                                    String datatype)
        Description copied from class: DefaultCodegen
        Return the sanitized variable name for enum
        Overrides:
        toEnumVarName in class DefaultCodegen
        Parameters:
        name - enum variable name
        datatype - data type
        Returns:
        the sanitized variable name for enum
      • testPackageName

        public String testPackageName()
      • isDataTypeString

        public boolean isDataTypeString​(String dataType)
        Description copied from class: DefaultCodegen
        checks if the data should be classified as "string" in enum e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string In the future, we may rename this function to "isEnumString"
        Overrides:
        isDataTypeString in class DefaultCodegen
        Parameters:
        dataType - data type
        Returns:
        true if it's a enum string
      • 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