All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.swagger.codegen.v3.CodegenConfig Maven / Gradle / Ivy

There is a newer version: 3.0.64
Show newest version
package io.swagger.codegen.v3;

import java.util.List;
import java.util.Map;
import java.util.Set;

import com.github.jknack.handlebars.Handlebars;
import com.samskivert.mustache.Mustache;
import io.swagger.codegen.v3.templates.TemplateEngine;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.security.SecurityScheme;

public interface CodegenConfig {
    CodegenType getTag();

    String getName();

    String getHelp();

    Map additionalProperties();

    Map vendorExtensions();

    String testPackage();

    String apiPackage();

    String apiFileFolder();

    String apiTestFileFolder();

    String apiDocFileFolder();

    String fileSuffix();

    String outputFolder();

    String templateDir();

    String embeddedTemplateDir();

    String customTemplateDir();

    String getTemplateVersion();

    String modelFileFolder();

    String modelTestFileFolder();

    String modelDocFileFolder();

    String modelPackage();

    String toApiName(String name);

    String toApiVarName(String name);

    String toModelName(String name);

    String toParamName(String name);

    String escapeText(String text);

    String escapeUnsafeCharacters(String input);

    String escapeReservedWord(String name);

    String escapeQuotationMark(String input);

    String getTypeDeclaration(Schema schema);

    String getTypeDeclaration(String name);

    void processOpts();

    List cliOptions();

    String generateExamplePath(String path, Operation operation);

    Set reservedWords();

    List supportingFiles();

    String getInputSpec();

    void setInputSpec(String inputSpec);

    String getInputURL();

    void setInputURL(String inputSpec);

    String getOutputDir();

    void setOutputDir(String dir);

    CodegenModel fromModel(String name, Schema schema);

    CodegenModel fromModel(String name, Schema schema, Map allDefinitions);

    CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map definitions, OpenAPI openAPI);

    CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map definitions);

    List fromSecurity(Map schemes);

    Set defaultIncludes();

    Map typeMapping();

    Map instantiationTypes();

    Map importMapping();

    Map apiTemplateFiles();

    Map modelTemplateFiles();

    Map apiTestTemplateFiles();

    Map modelTestTemplateFiles();

    Map apiDocTemplateFiles();

    Map modelDocTemplateFiles();

    Set languageSpecificPrimitives();

    Map reservedWordsMappings();

    void preprocessOpenAPI(OpenAPI openAPI);

    void processOpenAPI(OpenAPI openAPI);

    Mustache.Compiler processCompiler(Mustache.Compiler compiler);

    TemplateEngine getTemplateEngine();

    String sanitizeName(String name);

    String sanitizeTag(String tag);

    String toApiFilename(String name);

    String toModelFilename(String name);

    String toApiTestFilename(String name);

    String toModelTestFilename(String name);

    String toApiDocFilename(String name);

    String toModelDocFilename(String name);

    String toModelImport(String name);

    String toApiImport(String name);

    void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations);

    Map postProcessAllModels(Map objs);

    Map postProcessModels(Map objs);

    Map postProcessOperations(Map objs);

    Map postProcessOperationsWithModels(Map objs, List allModels);

    Map postProcessSupportingFileData(Map objs);

    void postProcessModelProperty(CodegenModel model, CodegenProperty property);

    void postProcessParameter(CodegenParameter parameter);

    String apiFilename(String templateName, String tag);

    String apiTestFilename(String templateName, String tag);

    String apiDocFilename(String templateName, String tag);

    boolean shouldOverwrite(String filename);

    boolean isSkipOverwrite();

    void setSkipOverwrite(boolean skipOverwrite);

    boolean isRemoveOperationIdPrefix();

    void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix);

    Map supportedLibraries();

    void setLibrary(String library);

    /**
     * Library template (sub-template).
     *
     * @return libray template
     */
    String getLibrary();

    void setGitUserId(String gitUserId);

    String getGitUserId();

    void setGitRepoId(String gitRepoId);

    String getGitRepoId();

    void setGitRepoBaseURL(String gitRepoBaseURL);

    String getGitRepoBaseURL();

    void setReleaseNote(String releaseNote);

    String getReleaseNote();

    void setHttpUserAgent(String httpUserAgent);

    String getHttpUserAgent();

    String getCommonTemplateDir();

    void setIgnoreFilePathOverride(String ignoreFileOverride);

    String getIgnoreFilePathOverride();

    String toBooleanGetter(String name);

    String toSetter(String name);

    String toGetter(String name);

    void addHandlebarHelpers(Handlebars handlebars);

    List readLanguageArguments();

    List getLanguageArguments();

    void setLanguageArguments(List codegenArguments);

    boolean needsUnflattenedSpec();

    void setUnflattenedOpenAPI(OpenAPI unflattenedOpenAPI);

    boolean getIgnoreImportMapping();

    void setIgnoreImportMapping(boolean ignoreImportMapping);

    boolean defaultIgnoreImportMappingOption();

    ISchemaHandler getSchemaHandler();

    default boolean checkAliasModel() {
        return false;
    }

    default boolean isPrivileged() {
        return false;
    }

    default int getPriority() {
        return Integer.MIN_VALUE;
    }

    default String getCodeName() {
        return getName();
    }
}