Class AbstractJuliaCodegen

    • Field Detail

      • LOGGER

        protected final org.slf4j.Logger LOGGER
      • srcPath

        protected String srcPath
      • apiSrcPath

        protected String apiSrcPath
      • modelSrcPath

        protected String modelSrcPath
      • apiDocPath

        protected String apiDocPath
      • modelDocPath

        protected String modelDocPath
      • packageName

        protected String packageName
      • exportModels

        protected Boolean exportModels
      • exportOperations

        protected Boolean exportOperations
    • Constructor Detail

      • AbstractJuliaCodegen

        public AbstractJuliaCodegen()
    • Method Detail

      • setPackageName

        public void setPackageName​(String packageName)
      • setExportModels

        public void setExportModels​(Boolean exportModels)
      • setExportOperations

        public void setExportOperations​(Boolean exportOperations)
      • dropDots

        protected static String dropDots​(String str)
      • 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 reseved words
        Specified by:
        escapeReservedWord in interface CodegenConfig
        Overrides:
        escapeReservedWord in class DefaultCodegen
        Parameters:
        name - the name to be escaped
        Returns:
        the escaped term
      • toApiName

        public String toApiName​(String name)
        Description copied from class: DefaultCodegen
        Output the API (class) name (capitalized) ending with the specified or default suffix Return DefaultApi if name is empty
        Specified by:
        toApiName in interface CodegenConfig
        Overrides:
        toApiName in class DefaultCodegen
        Parameters:
        name - the name of the Api
        Returns:
        capitalized Api 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
      • 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
      • needsVarEscape

        protected boolean needsVarEscape​(String name)
      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.v3.oas.models.media.Schema schema)
        Description copied from class: DefaultCodegen
        Output the language-specific type declaration of the property.
        Specified by:
        getTypeDeclaration in interface CodegenConfig
        Overrides:
        getTypeDeclaration in class DefaultCodegen
        Parameters:
        schema - property schema
        Returns:
        a string presentation of the property type
      • getSchemaType

        public String getSchemaType​(io.swagger.v3.oas.models.media.Schema schema)
        Return the type declaration for a given schema
        Overrides:
        getSchemaType in class DefaultCodegen
        Parameters:
        schema - the schema
        Returns:
        the type declaration
      • toDefaultValue

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

        protected String escapeRegex​(String pattern)
      • 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
      • fromProperty

        public CodegenProperty fromProperty​(String name,
                                            io.swagger.v3.oas.models.media.Schema schema,
                                            boolean required)
        Convert OAS Property schema to Codegen Property object.

        The return value is cached. An internal cache is looked up to determine if the CodegenProperty return value has already been instantiated for the (String name, Schema schema) arguments. Any subsequent processing of the CodegenModel return value must be idempotent for a given (String name, Schema schema).

        Overrides:
        fromProperty in class DefaultCodegen
        Parameters:
        name - name of the property
        schema - OAS property schema
        required - true if the property is required in the next higher object schema, false otherwise
        Returns:
        Codegen Property object
      • toOperationId

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

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