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

org.openapitools.codegen.CodegenConfig Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
/*
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 * Copyright 2018 SmartBear Software
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openapitools.codegen;

import com.samskivert.mustache.Mustache.Compiler;
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;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.meta.FeatureSet;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.model.ModelMap;
import org.openapitools.codegen.model.ModelsMap;
import org.openapitools.codegen.model.OperationsMap;
import org.openapitools.codegen.model.WebhooksMap;

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

public interface CodegenConfig {
    String getFilesMetadataFilename();

    String getVersionMetadataFilename();

    GeneratorMetadata getGeneratorMetadata();

    CodegenType getTag();

    String getName();

    String getHelp();

    Map additionalProperties();

    Map serverVariableOverrides();

    Map vendorExtensions();

    Map templateOutputDirs();

    String testPackage();

    String apiPackage();

    String apiFileFolder();

    String apiTestFileFolder();

    String apiDocFileFolder();

    String fileSuffix();

    String outputFolder();

    String templateDir();

    String embeddedTemplateDir();

    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 escapeTextWhileAllowingNewLines(String text);

    String encodePath(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 getOutputDir();

    void setOutputDir(String dir);

    CodegenModel fromModel(String name, Schema schema);

    CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, List servers);

    List fromSecurity(Map schemas);

    List fromServers(List servers);

    List fromServerVariables(Map variables);

    Set defaultIncludes();

    Map typeMapping();

    Map instantiationTypes();

    Map importMapping();

    Map schemaMapping();

    Map inlineSchemaNameMapping();

    Map inlineSchemaOption();

    Map nameMapping();

    Map parameterNameMapping();

    Map modelNameMapping();

    Map enumNameMapping();

    Map operationIdNameMapping();

    Map openapiNormalizer();

    Map apiTemplateFiles();

    Map modelTemplateFiles();

    Map apiTestTemplateFiles();

    Map modelTestTemplateFiles();

    Map apiDocTemplateFiles();

    Map modelDocTemplateFiles();

    Set languageSpecificPrimitives();

    Set openapiGeneratorIgnoreList();

    Map reservedWordsMappings();

    void preprocessOpenAPI(OpenAPI openAPI);

    void processOpenAPI(OpenAPI openAPI);

    Compiler processCompiler(Compiler compiler);

    TemplatingEngineAdapter processTemplatingEngine(TemplatingEngineAdapter templatingEngine);

    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);

    Map toModelImportMap(String name);

    String toApiImport(String name);

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

    Map updateAllModels(Map objs);

    void postProcess();

    Map postProcessAllModels(Map objs);

    ModelsMap postProcessModels(ModelsMap objs);

    OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels);

    WebhooksMap postProcessWebhooksWithModels(WebhooksMap objs, List allModels);

    Map postProcessSupportingFileData(Map objs);

    void postProcessModelProperty(CodegenModel model, CodegenProperty property);

    void postProcessResponseWithProperty(CodegenResponse response, CodegenProperty property);

    void postProcessParameter(CodegenParameter parameter);

    String modelFilename(String templateName, String modelName);

    String modelFilename(String templateName, String modelName, String outputDir);

    String apiFilename(String templateName, String tag);

    String apiFilename(String templateName, String tag, String outputDir);

    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);

    boolean isSkipOperationExample();

    void setSkipOperationExample(boolean skipOperationExample);

    public boolean isHideGenerationTimestamp();

    public void setHideGenerationTimestamp(boolean hideGenerationTimestamp);

    Map supportedLibraries();

    void setLibrary(String library);

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

    void setGitHost(String gitHost);

    String getGitHost();

    void setGitUserId(String gitUserId);

    String getGitUserId();

    void setGitRepoId(String gitRepoId);

    String getGitRepoId();

    void setReleaseNote(String releaseNote);

    String getReleaseNote();

    void setHttpUserAgent(String httpUserAgent);

    String getHttpUserAgent();

    void setDocExtension(String docExtension);

    String getDocExtension();

    void setIgnoreFilePathOverride(String ignoreFileOverride);

    String getIgnoreFilePathOverride();

    String toBooleanGetter(String name);

    String toSetter(String name);

    String toGetter(String name);

    String sanitizeName(String name);

    void postProcessFile(File file, String fileType);

    boolean isEnablePostProcessFile();

    void setEnablePostProcessFile(boolean isEnablePostProcessFile);

    /**
     * Set the OpenAPI instance. This method needs to be called right after the instantiation of the Codegen class.
     *
     * @param openAPI specification being generated
     */
    void setOpenAPI(OpenAPI openAPI);

    void setTemplatingEngine(TemplatingEngineAdapter s);

    TemplatingEngineAdapter getTemplatingEngine();

    public boolean isEnableMinimalUpdate();

    public void setEnableMinimalUpdate(boolean isEnableMinimalUpdate);

    boolean isStrictSpecBehavior();

    void setStrictSpecBehavior(boolean strictSpecBehavior);

    FeatureSet getFeatureSet();

    boolean isRemoveEnumValuePrefix();

    void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix);

    Schema unaliasSchema(Schema schema);

    String defaultTemplatingEngine();

    GeneratorLanguage generatorLanguage();

    /*
    the version of the language that the generator implements
    For python 3.9.0, generatorLanguageVersion would be "3.9.0"
    */
    String generatorLanguageVersion();

    boolean isTypeErasedGenerics();

    List getSupportedVendorExtensions();

    boolean getUseInlineModelResolver();

    boolean getAddSuffixToDuplicateOperationNicknames();

    boolean getUseOpenapiNormalizer();

    Set getOpenapiGeneratorIgnoreList();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy