[all] Move feature set setter (#5460)

When I originally implemented the feature set code, I added the
getter/setter on DefaultCodegen and CodegenConfig as well as on
GeneratorMetadata. GeneratorMetadata also includes the library variation
features. When I went to add library-specific features, I realized the
discrepancy.

This removes the public setter from DefaultCodegen/CodegenConfig, and
adds a protected modifyFeatureSet which accepts a lambda and hides the
builder logic away in the method.

This will be a breaking change for anyone who's created a custom
generator in 4.2.3, so the impact is very limited.
This commit is contained in:
Jim Schubert 2020-02-28 01:45:06 -05:00 committed by GitHub
parent ca944542e0
commit 36b1a61b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
115 changed files with 216 additions and 258 deletions

View File

@ -268,7 +268,7 @@ public class ConfigHelp implements Runnable {
if (Boolean.TRUE.equals(featureSets)) {
sb.append(newline).append("## FEATURE SET").append(newline).append(newline);
List<FeatureSet.FeatureSetFlattened> flattened = config.getFeatureSet().flatten();
List<FeatureSet.FeatureSetFlattened> flattened = config.getGeneratorMetadata().getFeatureSet().flatten();
flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory));
AtomicReference<String> lastCategory = new AtomicReference<>();
@ -385,7 +385,7 @@ public class ConfigHelp implements Runnable {
if (Boolean.TRUE.equals(featureSets)) {
sb.append(newline).append("FEATURE SET").append(newline);
List<FeatureSet.FeatureSetFlattened> flattened = config.getFeatureSet().flatten();
List<FeatureSet.FeatureSetFlattened> flattened = config.getGeneratorMetadata().getFeatureSet().flatten();
flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory));
AtomicReference<String> lastCategory = new AtomicReference<>();

View File

@ -287,8 +287,6 @@ public interface CodegenConfig {
FeatureSet getFeatureSet();
void setFeatureSet(FeatureSet featureSet);
boolean isRemoveEnumValuePrefix();
void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix);

View File

@ -67,6 +67,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@ -124,7 +125,6 @@ public class DefaultCodegen implements CodegenConfig {
.build();
}
protected FeatureSet featureSet;
protected GeneratorMetadata generatorMetadata;
protected String inputSpec;
protected String outputFolder = "";
@ -1289,10 +1289,9 @@ public class DefaultCodegen implements CodegenConfig {
codegenType = CodegenType.OTHER;
}
featureSet = DefaultFeatureSet;
generatorMetadata = GeneratorMetadata.newBuilder()
.stability(Stability.STABLE)
.featureSet(DefaultFeatureSet)
.generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue()))
.build();
@ -5676,12 +5675,7 @@ public class DefaultCodegen implements CodegenConfig {
@Override
public FeatureSet getFeatureSet() {
return this.featureSet;
}
@Override
public void setFeatureSet(final FeatureSet featureSet) {
this.featureSet = featureSet == null ? DefaultFeatureSet : featureSet;
return this.generatorMetadata.getFeatureSet();
}
/**
@ -5746,4 +5740,11 @@ public class DefaultCodegen implements CodegenConfig {
public void addImportsToOneOfInterface(List<Map<String, String>> imports) {}
//// End of methods related to the "useOneOfInterfaces" feature
protected void modifyFeatureSet(Consumer<FeatureSet.Builder> processor) {
FeatureSet.Builder builder = getFeatureSet().modify();
processor.accept(builder);
this.generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.featureSet(builder.build()).build();
}
}

View File

@ -101,7 +101,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public AbstractJavaCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(
@ -119,7 +119,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
supportsInheritance = true;
modelTemplateFiles.put("model.mustache", ".java");

View File

@ -82,7 +82,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
public AbstractTypeScriptClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(
@ -100,7 +100,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// clear import mapping (from default generator) as TS does not use it
// at the moment

View File

@ -57,7 +57,7 @@ public class AdaCodegen extends AbstractAdaCodegen implements CodegenConfig {
super.processOpts();
// TODO: Ada maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.excludeDocumentationFeatures(DocumentationFeature.Readme)
.excludeWireFormatFeatures(
WireFormatFeature.XML,
@ -86,7 +86,7 @@ public class AdaCodegen extends AbstractAdaCodegen implements CodegenConfig {
ParameterFeature.Cookie
)
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
.build();
);
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME);

View File

@ -36,7 +36,7 @@ public class AdaServerCodegen extends AbstractAdaCodegen implements CodegenConfi
super();
// TODO: Ada maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.excludeWireFormatFeatures(
WireFormatFeature.XML,
@ -64,7 +64,7 @@ public class AdaServerCodegen extends AbstractAdaCodegen implements CodegenConfi
ParameterFeature.Cookie
)
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
.build();
);
}
@Override

View File

@ -61,7 +61,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
super();
// TODO: Android client maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.excludeWireFormatFeatures(
WireFormatFeature.PROTOBUF
@ -87,7 +87,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
ParameterFeature.Cookie
)
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
.build();
);
outputFolder = "generated-code/android";
modelTemplateFiles.put("model.mustache", ".java");

View File

@ -52,7 +52,7 @@ public class Apache2ConfigCodegen extends DefaultCodegen implements CodegenConfi
super();
// TODO: Apache2 maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.parameterFeatures(EnumSet.of(ParameterFeature.Path))
.securityFeatures(EnumSet.of(SecurityFeature.BasicAuth))
.dataTypeFeatures(EnumSet.noneOf(DataTypeFeature.class))
@ -61,7 +61,7 @@ public class Apache2ConfigCodegen extends DefaultCodegen implements CodegenConfi
.globalFeatures(EnumSet.noneOf(GlobalFeature.class))
.schemaSupportFeatures(EnumSet.noneOf(SchemaSupportFeature.class))
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
.build();
);
apiTemplateFiles.put("apache-config.mustache", ".conf");

View File

@ -187,13 +187,13 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
super();
// TODO: Asciidoc maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
.globalFeatures(EnumSet.noneOf(GlobalFeature.class))
.schemaSupportFeatures(EnumSet.noneOf(SchemaSupportFeature.class))
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
.build();
);
LOGGER.trace("start asciidoc codegen");

View File

@ -89,7 +89,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
super();
// TODO: AspnetCore community review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.excludeWireFormatFeatures(WireFormatFeature.PROTOBUF)
.includeSecurityFeatures(
@ -117,7 +117,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code" + File.separator + getName();

View File

@ -44,7 +44,7 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
.build();
// TODO: Avro maintainer review.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.parameterFeatures(EnumSet.noneOf(ParameterFeature.class))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.wireFormatFeatures(EnumSet.noneOf(WireFormatFeature.class))
@ -55,7 +55,7 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
SchemaSupportFeature.Union
)
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
.build();
);
outputFolder = "generated-code/avro-schema";
modelTemplateFiles.put("model.mustache", ".avsc");

View File

@ -103,7 +103,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
super();
// TODO: Bash maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.documentationFeatures(EnumSet.of(
DocumentationFeature.Readme
))
@ -125,7 +125,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
SchemaSupportFeature.Polymorphism,
SchemaSupportFeature.Union
)
.build();
);
setReservedWordsLowerCase(
Arrays.asList(

View File

@ -53,7 +53,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
// TODO: c maintainer review
// Assumes that C community considers api/model header files as documentation.
// Generator supports Basic, OAuth, and API key explicitly. Bearer is excluded although clients are able to set headers directly.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(
DocumentationFeature.Readme
)
@ -73,7 +73,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
SchemaSupportFeature.Polymorphism,
SchemaSupportFeature.Union
)
.build();
);
modelPackage = "models";
apiPackage = "api";

View File

@ -80,7 +80,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
public CSharpClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -103,7 +103,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
supportsInheritance = true;
modelTemplateFiles.put("model.mustache", ".cs");

View File

@ -41,9 +41,7 @@ public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
public CSharpDotNet2ClientCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.DEPRECATED)

View File

@ -69,7 +69,7 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
public CSharpNancyFXServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.excludeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.excludeGlobalFeatures(
@ -84,7 +84,7 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code" + File.separator + getName();
apiTemplateFiles.put("api.mustache", ".cs");

View File

@ -92,7 +92,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
public CSharpNetCoreClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -115,7 +115,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
// mapped non-nullable type without ?
typeMapping = new HashMap<String, String>();

View File

@ -64,7 +64,7 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
super();
// TODO: Clojure maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.excludeDocumentationFeatures(
DocumentationFeature.Readme
)
@ -80,7 +80,7 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
SchemaSupportFeature.Polymorphism,
SchemaSupportFeature.Union
)
.build();
);
outputFolder = "generated-code" + File.separator + "clojure";
modelTemplateFiles.put("spec.mustache", ".clj");

View File

@ -36,7 +36,7 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
super();
// TODO: ConfluenceWiki maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.documentationFeatures(EnumSet.noneOf(DocumentationFeature.class))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.excludeParameterFeatures(ParameterFeature.Cookie)
@ -49,7 +49,7 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
SchemaSupportFeature.Polymorphism,
SchemaSupportFeature.Union
)
.build();
);
outputFolder = "docs";
embeddedTemplateDir = templateDir = "confluenceWikiDocs";

View File

@ -69,7 +69,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
super();
// TODO: cpp-pistache-server maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.excludeGlobalFeatures(
@ -85,7 +85,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
if (StringUtils.isEmpty(modelNamePrefix)) {
modelNamePrefix = PREFIX;

View File

@ -34,7 +34,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
public CppQt5AbstractCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.excludeWireFormatFeatures(WireFormatFeature.PROTOBUF)
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.excludeGlobalFeatures(
@ -50,7 +50,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// set modelNamePrefix as default for QHttpEngine Server
if (StringUtils.isEmpty(modelNamePrefix)) {

View File

@ -39,9 +39,7 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
public CppQt5QHttpEngineServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
// set the output folder here
outputFolder = "generated-code/cpp-qt5-qhttpengine-server";

View File

@ -80,7 +80,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
super();
// TODO: cpp-restsdk maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.BasicAuth,
@ -100,7 +100,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
apiPackage = "org.openapitools.client.api";
modelPackage = "org.openapitools.client.model";

View File

@ -47,7 +47,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
super();
// TODO: cpp-restbed-server maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.excludeGlobalFeatures(
@ -63,7 +63,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
apiPackage = "org.openapitools.server.api";
modelPackage = "org.openapitools.server.model";

View File

@ -43,7 +43,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen
super();
// TODO: cpp-tizen maintainer review
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.BearerToken
@ -61,7 +61,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "";
modelTemplateFiles.put("model-header.mustache", ".h");

View File

@ -66,7 +66,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
public DartClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -88,7 +88,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// clear import mapping (from default generator) as dart does not use it at the moment
importMapping.clear();

View File

@ -62,7 +62,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
public DartJaguarClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -84,7 +84,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
browserClient = false;
outputFolder = "generated-code/dart-jaguar";

View File

@ -61,7 +61,7 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
public EiffelClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -84,7 +84,7 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
uuid = UUID.randomUUID();
uuidTest = UUID.randomUUID();

View File

@ -61,7 +61,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
public ElixirClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.securityFeatures(EnumSet.of(
SecurityFeature.OAuth2_Implicit,
@ -82,7 +82,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// set the output folder here
outputFolder = "generated-code/elixir";

View File

@ -76,7 +76,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
public ElmClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -95,7 +95,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
outputFolder = "generated-code/elm";
modelTemplateFiles.put("model.mustache", ".elm");

View File

@ -58,7 +58,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
public ErlangClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(SecurityFeature.ApiKey))
@ -77,7 +77,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
outputFolder = "generated-code/erlang";
modelTemplateFiles.put("model.mustache", ".erl");

View File

@ -60,7 +60,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
public ErlangProperCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(
@ -82,7 +82,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
outputFolder = "generated-code/erlang";
modelTemplateFiles.put("model.mustache", ".erl");

View File

@ -43,7 +43,7 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
public ErlangServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(
@ -62,7 +62,7 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// set the output folder here
outputFolder = "generated-code/erlang-server";

View File

@ -46,7 +46,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
public FlashClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -67,7 +67,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
modelPackage = "org.openapitools.client.model";
apiPackage = "org.openapitools.client.api";

View File

@ -54,7 +54,7 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen {
super();
// TODO: There's a README.mustache, but it doesn't seem to be referenced
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
// .includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(
@ -74,7 +74,7 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen {
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)

View File

@ -61,9 +61,8 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
public FsharpGiraffeServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)

View File

@ -44,7 +44,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
public GoClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -71,7 +71,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
outputFolder = "generated-code/go";
modelTemplateFiles.put("model.mustache", ".go");

View File

@ -42,7 +42,7 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
public GoGinServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(
@ -60,7 +60,7 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// set the output folder here
outputFolder = "generated-code/go";

View File

@ -47,7 +47,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
public GoServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(
@ -65,7 +65,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// set the output folder here
outputFolder = "generated-code/go";

View File

@ -50,7 +50,7 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im
public GraphQLNodeJSExpressServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(
@ -68,7 +68,7 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
packageName = "openapi3graphql-server";
packageVersion = "1.0.0";

View File

@ -46,7 +46,7 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code
public GraphQLSchemaCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
// .includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(
@ -61,7 +61,7 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
outputFolder = "generated-code/graphql-schema";
modelTemplateFiles.put("model.mustache", ".graphql");

View File

@ -33,7 +33,7 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
public GroovyClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -52,7 +52,7 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// avoid importing the following as models
languageSpecificPrimitives.add("Date");

View File

@ -170,7 +170,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
public HaskellHttpClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -194,7 +194,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
this.prependFormOrBodyParameters = true;

View File

@ -81,7 +81,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
public HaskellServantCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -101,7 +101,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// override the mapping to keep the original mapping in Haskell
specialCharReplacements.put("-", "Dash");

View File

@ -75,7 +75,7 @@ public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig
public JMeterClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
SecurityFeature.BasicAuth,
@ -97,7 +97,7 @@ public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// set the output folder here
outputFolder = "generated-code/JMeterClientCodegen";

View File

@ -108,10 +108,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
super();
// TODO: Move GlobalFeature.ParameterizedServer to library: jersey after moving featureSet to generatorMetadata
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.includeGlobalFeatures(GlobalFeature.ParameterizedServer)
.build();
);
outputFolder = "generated-code" + File.separator + "java";
embeddedTemplateDir = templateDir = "Java";

View File

@ -41,9 +41,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {
public JavaInflectorServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
sourceFolder = "src/gen/java";
apiTestTemplateFiles.clear(); // TODO: add test template

View File

@ -56,9 +56,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
public JavaJAXRSSpecServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
invokerPackage = "org.openapitools.api";
artifactId = "openapi-jaxrs-server";

View File

@ -41,9 +41,7 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
public JavaJerseyServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
outputFolder = "generated-code/JavaJaxRS-Jersey";

View File

@ -39,9 +39,7 @@ public class JavaMSF4JServerCodegen extends AbstractJavaJAXRSServerCodegen {
public JavaMSF4JServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
outputFolder = "generated-code/JavaJaxRS-MSF4J";
apiTemplateFiles.put("apiService.mustache", ".java");

View File

@ -54,9 +54,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
public JavaPKMSTServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
groupId = "com.prokarma";
artifactId = "pkmst-microservice";

View File

@ -58,9 +58,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
public JavaPlayFrameworkCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
outputFolder = "generated-code/javaPlayFramework";
apiTestTemplateFiles.clear();

View File

@ -41,9 +41,7 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen
public JavaResteasyEapServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
artifactId = "openapi-jaxrs-resteasy-eap-server";
useBeanValidation = true;

View File

@ -37,9 +37,7 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im
public JavaResteasyServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
artifactId = "openapi-jaxrs-resteasy-server";
outputFolder = "generated-code/JavaJaxRS-Resteasy";

View File

@ -42,9 +42,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen {
public JavaUndertowServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
embeddedTemplateDir = templateDir = "java-undertow-server";
invokerPackage = "org.openapitools.handler";

View File

@ -59,9 +59,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen {
public JavaVertXServerCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
// set the output folder here
outputFolder = "generated-code" + File.separator + "javaVertXServer";

View File

@ -94,9 +94,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
public JavascriptClientCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
outputFolder = "generated-code/js";
modelTemplateFiles.put("model.mustache", ".js");

View File

@ -37,9 +37,7 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo
public JavascriptFlowtypedClientCodegen() {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
// clear import mapping (from default generator) as TS does not use it
// at the moment

View File

@ -99,7 +99,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
/*
* OAuth flows supported _only_ by client explicitly setting bearer token. The "flows" are not supported.
*/
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.excludeWireFormatFeatures(WireFormatFeature.XML, WireFormatFeature.PROTOBUF)
.excludeSecurityFeatures(
@ -122,7 +122,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
ParameterFeature.Cookie
)
.includeClientModificationFeatures(ClientModificationFeature.BasePath)
.build();
);
artifactId = "kotlin-client";
packageName = "org.openapitools.client";

View File

@ -60,7 +60,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
public KotlinServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -80,7 +80,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
artifactId = "kotlin-server";
packageName = "org.openapitools.server";

View File

@ -85,7 +85,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
public KotlinSpringServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -105,7 +105,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
reservedWords.addAll(VARIABLE_RESERVED_WORDS);

View File

@ -54,7 +54,7 @@ public class KotlinVertxServerCodegen extends AbstractKotlinCodegen {
public KotlinVertxServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(
@ -72,7 +72,7 @@ public class KotlinVertxServerCodegen extends AbstractKotlinCodegen {
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)

View File

@ -57,7 +57,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
public LuaClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -77,7 +77,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code/lua";
modelTemplateFiles.put("model.mustache", ".lua");

View File

@ -63,7 +63,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
public MysqlSchemaCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.noneOf(WireFormatFeature.class))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -77,7 +77,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
SchemaSupportFeature.Polymorphism
)
.clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class))
.build();
);
// clear import mapping (from default generator) as mysql does not use import directives
importMapping.clear();

View File

@ -56,7 +56,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
public NimClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -76,7 +76,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)

View File

@ -57,7 +57,7 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege
public NodeJSExpressServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(
@ -75,7 +75,7 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege
.includeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)

View File

@ -61,7 +61,7 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
public NodeJSServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -77,7 +77,7 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// mark the generator as deprecated in the documentation
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)

View File

@ -75,7 +75,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig
public OCamlClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(
@ -93,7 +93,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
outputFolder = "generated-code/ocaml";

View File

@ -66,7 +66,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
public ObjcClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON))
.securityFeatures(EnumSet.of(
@ -87,7 +87,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
supportsInheritance = true;
outputFolder = "generated-code" + File.separator + "objc";

View File

@ -39,7 +39,7 @@ public class OpenAPIGenerator extends DefaultCodegen implements CodegenConfig {
public OpenAPIGenerator() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.documentationFeatures(EnumSet.allOf(DocumentationFeature.class))
.dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class))
.wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class))
@ -47,7 +47,7 @@ public class OpenAPIGenerator extends DefaultCodegen implements CodegenConfig {
.globalFeatures(EnumSet.allOf(GlobalFeature.class))
.parameterFeatures(EnumSet.allOf(ParameterFeature.class))
.schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class))
.build();
);
embeddedTemplateDir = templateDir = "openapi";
outputFolder = "generated-code/openapi";

View File

@ -43,7 +43,7 @@ public class OpenAPIYamlGenerator extends DefaultCodegen implements CodegenConfi
public OpenAPIYamlGenerator() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.documentationFeatures(EnumSet.allOf(DocumentationFeature.class))
.dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class))
.wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class))
@ -51,7 +51,7 @@ public class OpenAPIYamlGenerator extends DefaultCodegen implements CodegenConfi
.globalFeatures(EnumSet.allOf(GlobalFeature.class))
.parameterFeatures(EnumSet.allOf(ParameterFeature.class))
.schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class))
.build();
);
embeddedTemplateDir = templateDir = "openapi-yaml";
outputFolder = "generated-code/openapi-yaml";

View File

@ -51,7 +51,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
public PerlClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -73,7 +73,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
// add multiple inheritance support (beta)
supportsMultipleInheritance = true;

View File

@ -39,7 +39,7 @@ public class PhpClientCodegen extends AbstractPhpCodegen {
public PhpClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -52,7 +52,7 @@ public class PhpClientCodegen extends AbstractPhpCodegen {
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
// clear import mapping (from default generator) as php does not use it
// at the moment

View File

@ -66,7 +66,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
public PhpLaravelServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -79,7 +79,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
embeddedTemplateDir = templateDir = "php-laravel";
variableNamingConvention = "camelCase";

View File

@ -62,7 +62,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
public PhpLumenServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -75,7 +75,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
embeddedTemplateDir = templateDir = "php-lumen";

View File

@ -39,7 +39,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
public PhpSilexServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -52,7 +52,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
invokerPackage = camelize("OpenAPIServer");
String packageName = "OpenAPIServer";

View File

@ -49,7 +49,7 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
public PhpSlimServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -62,7 +62,7 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.DEPRECATED)

View File

@ -82,7 +82,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
public PhpSymfonyServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -95,7 +95,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
// clear import mapping (from default generator) as php does not use it
// at the moment

View File

@ -59,7 +59,7 @@ public class PhpZendExpressivePathHandlerServerCodegen extends AbstractPhpCodege
public PhpZendExpressivePathHandlerServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -72,7 +72,7 @@ public class PhpZendExpressivePathHandlerServerCodegen extends AbstractPhpCodege
.excludeSchemaSupportFeatures(
SchemaSupportFeature.Polymorphism
)
.build();
);
//no point to use double - http://php.net/manual/en/language.types.float.php , especially because of PHP 7+ float type declaration
typeMapping.put("double", "float");

View File

@ -50,7 +50,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
public PowerShellClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))
.securityFeatures(EnumSet.of(
@ -70,7 +70,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code" + File.separator + "powershell";
modelTemplateFiles.put("model.mustache", ".ps1");

View File

@ -69,12 +69,12 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
.stability(Stability.BETA)
.build();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.includeWireFormatFeatures(WireFormatFeature.PROTOBUF)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.PROTOBUF))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
.build();
);
outputFolder = "generated-code/protobuf-schema";
modelTemplateFiles.put("model.mustache", ".proto");

View File

@ -65,9 +65,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme
public PythonAbstractConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) {
super();
featureSet = getFeatureSet().modify()
.includeDocumentationFeatures(DocumentationFeature.Readme)
.build();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
fixBodyName = fixBodyNameValue;
modelPackage = "models";

View File

@ -28,7 +28,7 @@ public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexion
public PythonAiohttpConnexionServerCodegen() {
super("python-aiohttp", true);
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -49,7 +49,7 @@ public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexion
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
testPackage = "tests";
embeddedTemplateDir = templateDir = "python-aiohttp";

View File

@ -33,7 +33,7 @@ public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServer
public PythonBluePlanetServerCodegen() {
super("python-blueplanet", true);
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -54,7 +54,7 @@ public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServer
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
testPackage = "tests";
embeddedTemplateDir = templateDir = "python-blueplanet";

View File

@ -59,7 +59,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
public PythonClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -80,7 +80,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// clear import mapping (from default generator) as python does not use it
// at the moment

View File

@ -53,7 +53,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
public PythonClientExperimentalCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -74,7 +74,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
// this may set datatype right for additional properties
instantiationTypes.put("map", "dict");

View File

@ -71,7 +71,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
public RClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -95,7 +95,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
outputFolder = "generated-code/r";
modelTemplateFiles.put("model.mustache", ".R");

View File

@ -70,7 +70,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
public RubyClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -95,7 +95,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
supportsInheritance = true;

View File

@ -74,7 +74,7 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen {
public RubyOnRailsServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -90,7 +90,7 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code" + File.separator + "rails5";
apiPackage = "app/controllers";

View File

@ -43,7 +43,7 @@ public class RubySinatraServerCodegen extends AbstractRubyCodegen {
public RubySinatraServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -59,7 +59,7 @@ public class RubySinatraServerCodegen extends AbstractRubyCodegen {
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
apiPackage = "lib";
outputFolder = "generated-code" + File.separator + "sinatra";

View File

@ -65,7 +65,7 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
public RustClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -89,7 +89,7 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
outputFolder = "generated-code/rust";
modelTemplateFiles.put("model.mustache", ".rs");

View File

@ -76,7 +76,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
public RustServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -101,7 +101,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
// Show the generation timestamp by default

View File

@ -57,7 +57,7 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code
public ScalaAkkaClientCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.of(
@ -81,7 +81,7 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code
ClientModificationFeature.BasePath,
ClientModificationFeature.UserAgent
)
.build();
);
outputFolder = "generated-code/scala-akka";
modelTemplateFiles.put("model.mustache", ".scala");

View File

@ -42,7 +42,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo
public ScalaFinchServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -58,7 +58,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code/finch";
modelTemplateFiles.put("model.mustache", ".scala");

View File

@ -82,7 +82,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen
// Although the generator supports authorization, it's done via manual header modification and it's done
// globally. This means it doesn't _technically_ support auth per OpenAPI Spec (which would allow, for example, a different API key per operation),
// so it's not listed here as supported.
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -101,7 +101,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
sourceFolder = "src" + File.separator + "gatling" + File.separator + "scala";

View File

@ -55,7 +55,7 @@ public class ScalaHttpClientCodegen extends AbstractScalaCodegen implements Code
.stability(Stability.DEPRECATED)
.build();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -74,7 +74,7 @@ public class ScalaHttpClientCodegen extends AbstractScalaCodegen implements Code
.includeClientModificationFeatures(
ClientModificationFeature.BasePath
)
.build();
);
outputFolder = "generated-code/scala-http-client";
modelTemplateFiles.put("model.mustache", ".scala");

View File

@ -39,7 +39,7 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
public ScalaLagomServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -55,7 +55,7 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code/scala-lagom-server";
modelTemplateFiles.put("model.mustache", ".scala");

View File

@ -59,7 +59,7 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
public ScalaPlayFrameworkServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -75,7 +75,7 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code" + File.separator + "scala-play-server";
modelTemplateFiles.put("model.mustache", ".scala");

View File

@ -31,7 +31,7 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg
public ScalatraServerCodegen() {
super();
featureSet = getFeatureSet().modify()
modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
@ -47,7 +47,7 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements Codeg
.excludeParameterFeatures(
ParameterFeature.Cookie
)
.build();
);
outputFolder = "generated-code/scalatra";
modelTemplateFiles.put("model.mustache", ".scala");

Some files were not shown because too many files have changed in this diff Show More