From f12a821708b04fe700a290af44d30baeaf65f8f5 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 26 Feb 2020 22:00:02 -0500 Subject: [PATCH] [all] Move feature set setter 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. --- .../openapitools/codegen/cmd/ConfigHelp.java | 4 ++-- .../openapitools/codegen/CodegenConfig.java | 2 -- .../openapitools/codegen/DefaultCodegen.java | 19 ++++++++++--------- .../languages/AbstractJavaCodegen.java | 4 ++-- .../AbstractTypeScriptClientCodegen.java | 4 ++-- .../codegen/languages/AdaCodegen.java | 4 ++-- .../codegen/languages/AdaServerCodegen.java | 4 ++-- .../languages/AndroidClientCodegen.java | 4 ++-- .../languages/Apache2ConfigCodegen.java | 4 ++-- .../AsciidocDocumentationCodegen.java | 4 ++-- .../languages/AspNetCoreServerCodegen.java | 4 ++-- .../codegen/languages/AvroSchemaCodegen.java | 4 ++-- .../codegen/languages/BashClientCodegen.java | 4 ++-- .../languages/CLibcurlClientCodegen.java | 4 ++-- .../languages/CSharpClientCodegen.java | 4 ++-- .../languages/CSharpDotNet2ClientCodegen.java | 4 +--- .../languages/CSharpNancyFXServerCodegen.java | 4 ++-- .../languages/CSharpNetCoreClientCodegen.java | 4 ++-- .../languages/ClojureClientCodegen.java | 4 ++-- .../languages/ConfluenceWikiCodegen.java | 4 ++-- .../languages/CppPistacheServerCodegen.java | 4 ++-- .../languages/CppQt5AbstractCodegen.java | 4 ++-- .../CppQt5QHttpEngineServerCodegen.java | 4 +--- .../languages/CppRestSdkClientCodegen.java | 4 ++-- .../languages/CppRestbedServerCodegen.java | 4 ++-- .../languages/CppTizenClientCodegen.java | 4 ++-- .../codegen/languages/DartClientCodegen.java | 4 ++-- .../languages/DartJaguarClientCodegen.java | 4 ++-- .../languages/EiffelClientCodegen.java | 4 ++-- .../languages/ElixirClientCodegen.java | 4 ++-- .../codegen/languages/ElmClientCodegen.java | 4 ++-- .../languages/ErlangClientCodegen.java | 4 ++-- .../languages/ErlangProperCodegen.java | 4 ++-- .../languages/ErlangServerCodegen.java | 4 ++-- .../codegen/languages/FlashClientCodegen.java | 4 ++-- .../FsharpFunctionsServerCodegen.java | 4 ++-- .../languages/FsharpGiraffeServerCodegen.java | 5 ++--- .../codegen/languages/GoClientCodegen.java | 4 ++-- .../codegen/languages/GoGinServerCodegen.java | 4 ++-- .../codegen/languages/GoServerCodegen.java | 4 ++-- .../GraphQLNodeJSExpressServerCodegen.java | 4 ++-- .../languages/GraphQLSchemaCodegen.java | 4 ++-- .../languages/GroovyClientCodegen.java | 4 ++-- .../languages/HaskellHttpClientCodegen.java | 4 ++-- .../languages/HaskellServantCodegen.java | 4 ++-- .../languages/JMeterClientCodegen.java | 4 ++-- .../codegen/languages/JavaClientCodegen.java | 4 ++-- .../languages/JavaInflectorServerCodegen.java | 4 +--- .../languages/JavaJAXRSSpecServerCodegen.java | 4 +--- .../languages/JavaJerseyServerCodegen.java | 4 +--- .../languages/JavaMSF4JServerCodegen.java | 4 +--- .../languages/JavaPKMSTServerCodegen.java | 4 +--- .../languages/JavaPlayFrameworkCodegen.java | 4 +--- .../JavaResteasyEapServerCodegen.java | 4 +--- .../languages/JavaResteasyServerCodegen.java | 4 +--- .../languages/JavaUndertowServerCodegen.java | 4 +--- .../languages/JavaVertXServerCodegen.java | 4 +--- .../languages/JavascriptClientCodegen.java | 4 +--- .../JavascriptFlowtypedClientCodegen.java | 4 +--- .../languages/KotlinClientCodegen.java | 4 ++-- .../languages/KotlinServerCodegen.java | 4 ++-- .../languages/KotlinSpringServerCodegen.java | 4 ++-- .../languages/KotlinVertxServerCodegen.java | 4 ++-- .../codegen/languages/LuaClientCodegen.java | 4 ++-- .../codegen/languages/MysqlSchemaCodegen.java | 4 ++-- .../codegen/languages/NimClientCodegen.java | 4 ++-- .../languages/NodeJSExpressServerCodegen.java | 4 ++-- .../languages/NodeJSServerCodegen.java | 4 ++-- .../codegen/languages/OCamlClientCodegen.java | 4 ++-- .../codegen/languages/ObjcClientCodegen.java | 4 ++-- .../codegen/languages/OpenAPIGenerator.java | 4 ++-- .../languages/OpenAPIYamlGenerator.java | 4 ++-- .../codegen/languages/PerlClientCodegen.java | 4 ++-- .../codegen/languages/PhpClientCodegen.java | 4 ++-- .../languages/PhpLaravelServerCodegen.java | 4 ++-- .../languages/PhpLumenServerCodegen.java | 4 ++-- .../languages/PhpSilexServerCodegen.java | 4 ++-- .../languages/PhpSlimServerCodegen.java | 4 ++-- .../languages/PhpSymfonyServerCodegen.java | 4 ++-- ...endExpressivePathHandlerServerCodegen.java | 4 ++-- .../languages/PowerShellClientCodegen.java | 4 ++-- .../languages/ProtobufSchemaCodegen.java | 4 ++-- .../PythonAbstractConnexionServerCodegen.java | 4 +--- .../PythonAiohttpConnexionServerCodegen.java | 4 ++-- .../PythonBluePlanetServerCodegen.java | 4 ++-- .../languages/PythonClientCodegen.java | 4 ++-- .../PythonClientExperimentalCodegen.java | 4 ++-- .../codegen/languages/RClientCodegen.java | 4 ++-- .../codegen/languages/RubyClientCodegen.java | 4 ++-- .../languages/RubyOnRailsServerCodegen.java | 4 ++-- .../languages/RubySinatraServerCodegen.java | 4 ++-- .../codegen/languages/RustClientCodegen.java | 4 ++-- .../codegen/languages/RustServerCodegen.java | 4 ++-- .../languages/ScalaAkkaClientCodegen.java | 4 ++-- .../languages/ScalaFinchServerCodegen.java | 4 ++-- .../languages/ScalaGatlingCodegen.java | 4 ++-- .../languages/ScalaHttpClientCodegen.java | 4 ++-- .../languages/ScalaLagomServerCodegen.java | 4 ++-- .../ScalaPlayFrameworkServerCodegen.java | 4 ++-- .../languages/ScalatraServerCodegen.java | 4 ++-- .../languages/ScalazClientCodegen.java | 4 ++-- .../codegen/languages/SpringCodegen.java | 4 ++-- .../codegen/languages/StaticDocCodegen.java | 4 ++-- .../languages/StaticHtml2Generator.java | 4 ++-- .../languages/StaticHtmlGenerator.java | 4 ++-- .../codegen/languages/Swift3Codegen.java | 4 ++-- .../codegen/languages/Swift4Codegen.java | 4 ++-- .../codegen/languages/SwiftClientCodegen.java | 4 ++-- .../TypeScriptAngularClientCodegen.java | 4 +--- .../TypeScriptAxiosClientCodegen.java | 4 +--- .../TypeScriptFetchClientCodegen.java | 4 +--- .../TypeScriptInversifyClientCodegen.java | 4 +--- .../TypeScriptJqueryClientCodegen.java | 4 +--- .../TypeScriptRxjsClientCodegen.java | 6 +++--- .../protobuf/ProtobufSchemaCodegenTest.java | 2 +- 115 files changed, 216 insertions(+), 258 deletions(-) diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 3e68b0c862d7..6c6f50b544e1 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -268,7 +268,7 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { if (Boolean.TRUE.equals(featureSets)) { sb.append(newline).append("## FEATURE SET").append(newline).append(newline); - List flattened = config.getFeatureSet().flatten(); + List flattened = config.getGeneratorMetadata().getFeatureSet().flatten(); flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); AtomicReference lastCategory = new AtomicReference<>(); @@ -385,7 +385,7 @@ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) { if (Boolean.TRUE.equals(featureSets)) { sb.append(newline).append("FEATURE SET").append(newline); - List flattened = config.getFeatureSet().flatten(); + List flattened = config.getGeneratorMetadata().getFeatureSet().flatten(); flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); AtomicReference lastCategory = new AtomicReference<>(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java index d00cc2b8b057..06fd6a30d627 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -287,8 +287,6 @@ public interface CodegenConfig { FeatureSet getFeatureSet(); - void setFeatureSet(FeatureSet featureSet); - boolean isRemoveEnumValuePrefix(); void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fe54c87dcb65..0ff45405560c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -67,6 +67,7 @@ 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 DefaultCodegen() { 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(); @@ -5675,12 +5674,7 @@ public void setStrictSpecBehavior(final boolean strictSpecBehavior) { @Override public FeatureSet getFeatureSet() { - return this.featureSet; - } - - @Override - public void setFeatureSet(final FeatureSet featureSet) { - this.featureSet = featureSet == null ? DefaultFeatureSet : featureSet; + return this.generatorMetadata.getFeatureSet(); } /** @@ -5745,4 +5739,11 @@ public void addOneOfInterfaceModel(ComposedSchema cs, String type) { public void addImportsToOneOfInterface(List> imports) {} //// End of methods related to the "useOneOfInterfaces" feature + + protected void modifyFeatureSet(Consumer processor) { + FeatureSet.Builder builder = getFeatureSet().modify(); + processor.accept(builder); + this.generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .featureSet(builder.build()).build(); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index ad230ea432d8..fdd625e88390 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -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 AbstractJavaCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); supportsInheritance = true; modelTemplateFiles.put("model.mustache", ".java"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 6fa57faf5a24..bd50a8ab9462 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -78,7 +78,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( @@ -96,7 +96,7 @@ public AbstractTypeScriptClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // clear import mapping (from default generator) as TS does not use it // at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaCodegen.java index 1726b0cda819..1b25ab3dbb4a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaCodegen.java @@ -57,7 +57,7 @@ public void processOpts() { super.processOpts(); // TODO: Ada maintainer review. - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .excludeDocumentationFeatures(DocumentationFeature.Readme) .excludeWireFormatFeatures( WireFormatFeature.XML, @@ -86,7 +86,7 @@ public void processOpts() { ParameterFeature.Cookie ) .includeClientModificationFeatures(ClientModificationFeature.BasePath) - .build(); + ); if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaServerCodegen.java index 329065b22cbd..4c8d365fcaa1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AdaServerCodegen.java @@ -36,7 +36,7 @@ public AdaServerCodegen() { super(); // TODO: Ada maintainer review. - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .excludeWireFormatFeatures( WireFormatFeature.XML, @@ -64,7 +64,7 @@ public AdaServerCodegen() { ParameterFeature.Cookie ) .includeClientModificationFeatures(ClientModificationFeature.BasePath) - .build(); + ); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index 150f723180d3..1e7349a53bd8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -61,7 +61,7 @@ public AndroidClientCodegen() { super(); // TODO: Android client maintainer review. - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .excludeWireFormatFeatures( WireFormatFeature.PROTOBUF @@ -87,7 +87,7 @@ public AndroidClientCodegen() { ParameterFeature.Cookie ) .includeClientModificationFeatures(ClientModificationFeature.BasePath) - .build(); + ); outputFolder = "generated-code/android"; modelTemplateFiles.put("model.mustache", ".java"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java index d3bbe7743613..5cd7dfb6c679 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java @@ -52,7 +52,7 @@ public Apache2ConfigCodegen() { 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 Apache2ConfigCodegen() { .globalFeatures(EnumSet.noneOf(GlobalFeature.class)) .schemaSupportFeatures(EnumSet.noneOf(SchemaSupportFeature.class)) .clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class)) - .build(); + ); apiTemplateFiles.put("apache-config.mustache", ".conf"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index 731e951ec612..9421ae29866c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -187,13 +187,13 @@ public AsciidocDocumentationCodegen() { 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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index fdcad979bf8f..66fe43864a7b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -89,7 +89,7 @@ public AspNetCoreServerCodegen() { super(); // TODO: AspnetCore community review - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .excludeWireFormatFeatures(WireFormatFeature.PROTOBUF) .includeSecurityFeatures( @@ -117,7 +117,7 @@ public AspNetCoreServerCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + getName(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java index 6e96542eaaf0..8d60bbed894d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java @@ -44,7 +44,7 @@ public AvroSchemaCodegen() { .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 AvroSchemaCodegen() { SchemaSupportFeature.Union ) .clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class)) - .build(); + ); outputFolder = "generated-code/avro-schema"; modelTemplateFiles.put("model.mustache", ".avsc"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 3c13a4a2f75f..bf59d7db699f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -103,7 +103,7 @@ public BashClientCodegen() { super(); // TODO: Bash maintainer review - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .documentationFeatures(EnumSet.of( DocumentationFeature.Readme )) @@ -125,7 +125,7 @@ public BashClientCodegen() { SchemaSupportFeature.Polymorphism, SchemaSupportFeature.Union ) - .build(); + ); setReservedWordsLowerCase( Arrays.asList( diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index 24c035ab87af..2b5830ea890e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -53,7 +53,7 @@ public CLibcurlClientCodegen() { // 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 CLibcurlClientCodegen() { SchemaSupportFeature.Polymorphism, SchemaSupportFeature.Union ) - .build(); + ); modelPackage = "models"; apiPackage = "api"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 4f318bb2b598..2c30b432da05 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -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 CSharpClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); supportsInheritance = true; modelTemplateFiles.put("model.mustache", ".cs"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java index 11d32d5f05fc..61af6a358431 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java @@ -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) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java index 2ca162a2c5e0..cc24632a2ec1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java @@ -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 CSharpNancyFXServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + getName(); apiTemplateFiles.put("api.mustache", ".cs"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 779f2b66c5eb..22e5597fbec5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -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 CSharpNetCoreClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); // mapped non-nullable type without ? typeMapping = new HashMap(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java index 48e4a123cdd2..cb31f4f895d4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java @@ -64,7 +64,7 @@ public ClojureClientCodegen() { super(); // TODO: Clojure maintainer review - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .excludeDocumentationFeatures( DocumentationFeature.Readme ) @@ -80,7 +80,7 @@ public ClojureClientCodegen() { SchemaSupportFeature.Polymorphism, SchemaSupportFeature.Union ) - .build(); + ); outputFolder = "generated-code" + File.separator + "clojure"; modelTemplateFiles.put("spec.mustache", ".clj"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index e368355cc670..1de98be94e73 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -36,7 +36,7 @@ public ConfluenceWikiCodegen() { 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 ConfluenceWikiCodegen() { SchemaSupportFeature.Polymorphism, SchemaSupportFeature.Union ) - .build(); + ); outputFolder = "docs"; embeddedTemplateDir = templateDir = "confluenceWikiDocs"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index ae72864d61e0..208e4d3735de 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -69,7 +69,7 @@ public CppPistacheServerCodegen() { 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 CppPistacheServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); if (StringUtils.isEmpty(modelNamePrefix)) { modelNamePrefix = PREFIX; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java index 82e4364eb91e..b6c86a6a1b0f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java @@ -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 CppQt5AbstractCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // set modelNamePrefix as default for QHttpEngine Server if (StringUtils.isEmpty(modelNamePrefix)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java index 3f33b21f8d34..7c35de11720f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index 68065389d47b..b0a4f574f0e5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -80,7 +80,7 @@ public CppRestSdkClientCodegen() { 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 CppRestSdkClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); apiPackage = "org.openapitools.client.api"; modelPackage = "org.openapitools.client.model"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index df4a08db9681..3234cfb4c9fb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -47,7 +47,7 @@ public CppRestbedServerCodegen() { 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 CppRestbedServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); apiPackage = "org.openapitools.server.api"; modelPackage = "org.openapitools.server.model"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java index 970753d6a28b..c0db6bec907b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java @@ -43,7 +43,7 @@ public CppTizenClientCodegen() { 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 CppTizenClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = ""; modelTemplateFiles.put("model-header.mustache", ".h"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 5bdaf70e5c56..4e966fc43cbd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -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 DartClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // clear import mapping (from default generator) as dart does not use it at the moment importMapping.clear(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index 934354fb2dfe..eabb64854a4c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -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 DartJaguarClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); browserClient = false; outputFolder = "generated-code/dart-jaguar"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java index e1f297956438..5784d2559067 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java @@ -61,7 +61,7 @@ public String getHelp() { public EiffelClientCodegen() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .securityFeatures(EnumSet.of( SecurityFeature.OAuth2_Implicit, @@ -84,7 +84,7 @@ public EiffelClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); uuid = UUID.randomUUID(); uuidTest = UUID.randomUUID(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index d96f85319a64..6f487e0d4757 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -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 ElixirClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // set the output folder here outputFolder = "generated-code/elixir"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index 903c92de2f09..780b055c579f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -76,7 +76,7 @@ public String getHelp() { 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 ElmClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); outputFolder = "generated-code/elm"; modelTemplateFiles.put("model.mustache", ".elm"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java index 02a25cd9cf52..48de55ac1425 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java @@ -58,7 +58,7 @@ public String getHelp() { 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 ErlangClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); outputFolder = "generated-code/erlang"; modelTemplateFiles.put("model.mustache", ".erl"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java index b48eb615be4e..096a688b9d36 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java @@ -60,7 +60,7 @@ public String getHelp() { 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 ErlangProperCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); outputFolder = "generated-code/erlang"; modelTemplateFiles.put("model.mustache", ".erl"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java index 068c36a6ffde..bdaa30e9614a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java @@ -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 ErlangServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // set the output folder here outputFolder = "generated-code/erlang-server"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java index c5a38e18077c..dddf6cd22fa7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java @@ -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 FlashClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); modelPackage = "org.openapitools.client.model"; apiPackage = "org.openapitools.client.api"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java index a90446eab29f..2ee536a765c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java @@ -54,7 +54,7 @@ public FsharpFunctionsServerCodegen() { 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 FsharpFunctionsServerCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java index ea4c79468b7d..44546ec001bf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java @@ -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) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 97f8099f9756..58a7090288c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -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 GoClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); outputFolder = "generated-code/go"; modelTemplateFiles.put("model.mustache", ".go"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java index 7d0d0990acc4..4fb58cd7ee80 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java @@ -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 GoGinServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // set the output folder here outputFolder = "generated-code/go"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index 08281463465c..df1ab569d127 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -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 GoServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // set the output folder here outputFolder = "generated-code/go"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java index bebc631748f7..35ab7e43366b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java @@ -50,7 +50,7 @@ public String getHelp() { 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 GraphQLNodeJSExpressServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); packageName = "openapi3graphql-server"; packageVersion = "1.0.0"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java index 99c13c20058f..a8d1bb35a77f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java @@ -46,7 +46,7 @@ public String getHelp() { 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 GraphQLSchemaCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); outputFolder = "generated-code/graphql-schema"; modelTemplateFiles.put("model.mustache", ".graphql"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java index 22c083218d60..1066f2294b90 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java @@ -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 GroovyClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // avoid importing the following as models languageSpecificPrimitives.add("Date"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 1f3ef7925b71..15a37e681e88 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -170,7 +170,7 @@ public String getHelp() { 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 HaskellHttpClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); this.prependFormOrBodyParameters = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index 14621f597610..024447f3dd33 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -81,7 +81,7 @@ public String getHelp() { 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 HaskellServantCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // override the mapping to keep the original mapping in Haskell specialCharReplacements.put("-", "Dash"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java index 17d2a1230f9c..5617b2973da4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java @@ -75,7 +75,7 @@ public String getHelp() { 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 JMeterClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // set the output folder here outputFolder = "generated-code/JMeterClientCodegen"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index acc4dcc3739b..07ece9aaea0c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -108,10 +108,10 @@ public JavaClientCodegen() { 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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java index e68737e72a71..97c7bdb50b39 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java @@ -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 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java index f47edb272eb8..a607dee5ac43 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java index a0bb1ac6eb46..7e299b45194e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java index 708b7447ee38..5b86c4178f39 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java @@ -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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java index 7095fa54a2d8..2cf3681bb0c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java index 90ce97233e23..fb6b93472dc8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java @@ -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(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java index a8d53dfa2838..0d7e6c42d129 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java @@ -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; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java index b8beedfee109..d817db3e7ce2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java index c051d13cb9a0..c4206e8a995b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java index a9e0332ca7e4..c0dd3c793e38 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 14e708a290e5..2beed8ba2f4a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java index 4d97d7043707..322b7b98e999 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java @@ -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 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 15ed281c16d7..4580ad56a907 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -99,7 +99,7 @@ public KotlinClientCodegen() { /* * 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 KotlinClientCodegen() { ParameterFeature.Cookie ) .includeClientModificationFeatures(ClientModificationFeature.BasePath) - .build(); + ); artifactId = "kotlin-client"; packageName = "org.openapitools.client"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index 25e40fcd6255..39f32bb0fc1c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -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 KotlinServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); artifactId = "kotlin-server"; packageName = "org.openapitools.server"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index c1b781ce9ffc..8658f878432d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -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 KotlinSpringServerCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); reservedWords.addAll(VARIABLE_RESERVED_WORDS); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java index 193358867c64..3398363e5eb1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java @@ -54,7 +54,7 @@ public String getHelp() { 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 KotlinVertxServerCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java index 564931583b10..29e64126947f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java @@ -57,7 +57,7 @@ public String getHelp() { 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 LuaClientCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/lua"; modelTemplateFiles.put("model.mustache", ".lua"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index 71a681f0eb67..fdf1d994e9ba 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -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 MysqlSchemaCodegen() { SchemaSupportFeature.Polymorphism ) .clientModificationFeatures(EnumSet.noneOf(ClientModificationFeature.class)) - .build(); + ); // clear import mapping (from default generator) as mysql does not use import directives importMapping.clear(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index a0fefd2485d2..101dbab1fb9d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -56,7 +56,7 @@ public String getHelp() { 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 NimClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java index 33f594db0ca6..73f9a133a588 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -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 NodeJSExpressServerCodegen() { .includeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java index d4a3c7594afe..86a5eb7f35f5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java @@ -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 NodeJSServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // mark the generator as deprecated in the documentation generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index 73635c0fbd77..d3e022bf6d6d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -75,7 +75,7 @@ public String getHelp() { 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 OCamlClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); outputFolder = "generated-code/ocaml"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index b35a821bf9b7..2fa81b97dd4e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -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 ObjcClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); supportsInheritance = true; outputFolder = "generated-code" + File.separator + "objc"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java index 3cd85d211038..a2c9ec35c1a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java @@ -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 OpenAPIGenerator() { .globalFeatures(EnumSet.allOf(GlobalFeature.class)) .parameterFeatures(EnumSet.allOf(ParameterFeature.class)) .schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class)) - .build(); + ); embeddedTemplateDir = templateDir = "openapi"; outputFolder = "generated-code/openapi"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java index 49c9fb788b22..4d678a5ad29f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java @@ -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 OpenAPIYamlGenerator() { .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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index c11841e31598..8eef21d0e89d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -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 PerlClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); // add multiple inheritance support (beta) supportsMultipleInheritance = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java index 09524470cdb7..5e85b1e0a4d9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java @@ -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 PhpClientCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); // clear import mapping (from default generator) as php does not use it // at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java index cccbc73925a1..f9aa0ecba440 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java @@ -66,7 +66,7 @@ public String getHelp() { 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 PhpLaravelServerCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); embeddedTemplateDir = templateDir = "php-laravel"; variableNamingConvention = "camelCase"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java index dbfca2627782..e5ef7bba34cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java @@ -62,7 +62,7 @@ public String getHelp() { 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 PhpLumenServerCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); embeddedTemplateDir = templateDir = "php-lumen"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index fb39852d2e9e..9307d1b221d8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -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 PhpSilexServerCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); invokerPackage = camelize("OpenAPIServer"); String packageName = "OpenAPIServer"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java index 8c5d84a8e5b0..a7b6267394e8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java @@ -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 PhpSlimServerCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.DEPRECATED) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 8d98f28e3dfd..8db491a15649 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -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 PhpSymfonyServerCodegen() { .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) - .build(); + ); // clear import mapping (from default generator) as php does not use it // at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java index 19436f73ef83..2189189121d9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java @@ -59,7 +59,7 @@ public String getHelp() { 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 PhpZendExpressivePathHandlerServerCodegen() { .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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index af8f712e93cf..cc2ba5bbd567 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -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 PowerShellClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "powershell"; modelTemplateFiles.put("model.mustache", ".ps1"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 66c731d077fa..c2bccf21152f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -69,12 +69,12 @@ public ProtobufSchemaCodegen() { .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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java index 21dd07fb6538..18256382d585 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java @@ -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"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java index c3afd660f4ac..7f9dd74bf3d2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java @@ -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 PythonAiohttpConnexionServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); testPackage = "tests"; embeddedTemplateDir = templateDir = "python-aiohttp"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java index dd60815d0d4f..6e7a32ca217c 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java @@ -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 PythonBluePlanetServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); testPackage = "tests"; embeddedTemplateDir = templateDir = "python-blueplanet"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index f8ce69ed964d..ca59f763d74c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -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 PythonClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // clear import mapping (from default generator) as python does not use it // at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index a9c57e3f07a0..58537ce5bf52 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -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 PythonClientExperimentalCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); // this may set datatype right for additional properties instantiationTypes.put("map", "dict"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index a6551c030121..85be42aca6f7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -71,7 +71,7 @@ public String getHelp() { 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 RClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); outputFolder = "generated-code/r"; modelTemplateFiles.put("model.mustache", ".R"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 9022c2462fc0..f28e94e6a9ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -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 RubyClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); supportsInheritance = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java index ddcc5c6f21ed..5dcd18c372b3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java @@ -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 RubyOnRailsServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "rails5"; apiPackage = "app/controllers"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java index 7f626aade4c0..23126e3b4a5a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubySinatraServerCodegen.java @@ -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 RubySinatraServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); apiPackage = "lib"; outputFolder = "generated-code" + File.separator + "sinatra"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 9292e7a82666..1f81ba8133be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -65,7 +65,7 @@ public String getHelp() { 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 RustClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); outputFolder = "generated-code/rust"; modelTemplateFiles.put("model.mustache", ".rs"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index b32bb274fd93..1076e3f545d2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -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 RustServerCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); // Show the generation timestamp by default diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index 7b3938edf418..33a11c8e025e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -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 ScalaAkkaClientCodegen() { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) - .build(); + ); outputFolder = "generated-code/scala-akka"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java index 000f0add07c9..d49f37e56225 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java @@ -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 ScalaFinchServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/finch"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java index 304b43a14ba8..4cd79f8644e3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java @@ -82,7 +82,7 @@ public ScalaGatlingCodegen() { // 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 ScalaGatlingCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); sourceFolder = "src" + File.separator + "gatling" + File.separator + "scala"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java index 0d6462160fd3..2e371e8b6c60 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java @@ -55,7 +55,7 @@ public ScalaHttpClientCodegen() { .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 ScalaHttpClientCodegen() { .includeClientModificationFeatures( ClientModificationFeature.BasePath ) - .build(); + ); outputFolder = "generated-code/scala-http-client"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java index c7f97cc6903d..c995798768f8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java @@ -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 ScalaLagomServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/scala-lagom-server"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java index 11acf405ff22..d0a723156778 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java @@ -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 ScalaPlayFrameworkServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "scala-play-server"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java index c511b29ba894..ccc335dacb32 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalatraServerCodegen.java @@ -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 ScalatraServerCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/scalatra"; modelTemplateFiles.put("model.mustache", ".scala"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java index 8274a6aa657e..78f8640ee17a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java @@ -45,7 +45,7 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen public ScalazClientCodegen() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) .excludeGlobalFeatures( @@ -60,7 +60,7 @@ public ScalazClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/scalaz"; embeddedTemplateDir = templateDir = "scalaz"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 5478f307bc93..8450fbd5f4de 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -102,7 +102,7 @@ public class SpringCodegen extends AbstractJavaCodegen public SpringCodegen() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .includeDocumentationFeatures(DocumentationFeature.Readme) .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) .securityFeatures(EnumSet.of( @@ -127,7 +127,7 @@ public SpringCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code/javaSpring"; embeddedTemplateDir = templateDir = "JavaSpring"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java index 9faa3e7144ab..ce43779dfd74 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java @@ -33,7 +33,7 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig { public StaticDocCodegen() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .documentationFeatures(EnumSet.allOf(DocumentationFeature.class)) .dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class)) .wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class)) @@ -41,7 +41,7 @@ public StaticDocCodegen() { .globalFeatures(EnumSet.allOf(GlobalFeature.class)) .parameterFeatures(EnumSet.allOf(ParameterFeature.class)) .schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class)) - .build(); + ); // clear import mapping (from default generator) as this generator does not use it // at the moment diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java index 2c523d6c6b0b..347b371c7769 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java @@ -55,7 +55,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi public StaticHtml2Generator() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .documentationFeatures(EnumSet.allOf(DocumentationFeature.class)) .dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class)) .wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class)) @@ -63,7 +63,7 @@ public StaticHtml2Generator() { .globalFeatures(EnumSet.allOf(GlobalFeature.class)) .parameterFeatures(EnumSet.allOf(ParameterFeature.class)) .schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class)) - .build(); + ); outputFolder = "docs"; embeddedTemplateDir = templateDir = "htmlDocs2"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java index a633da650a86..c50f4492b402 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java @@ -41,7 +41,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig public StaticHtmlGenerator() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .documentationFeatures(EnumSet.allOf(DocumentationFeature.class)) .dataTypeFeatures(EnumSet.allOf(DataTypeFeature.class)) .wireFormatFeatures(EnumSet.allOf(WireFormatFeature.class)) @@ -49,7 +49,7 @@ public StaticHtmlGenerator() { .globalFeatures(EnumSet.allOf(GlobalFeature.class)) .parameterFeatures(EnumSet.allOf(ParameterFeature.class)) .schemaSupportFeatures(EnumSet.allOf(SchemaSupportFeature.class)) - .build(); + ); outputFolder = "docs"; embeddedTemplateDir = templateDir = "htmlDocs"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java index 1f5e53684105..e2f798df5dc2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java @@ -76,7 +76,7 @@ public Swift3Codegen() { .stability(Stability.DEPRECATED) .build(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) .excludeGlobalFeatures( @@ -91,7 +91,7 @@ public Swift3Codegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "swift"; modelTemplateFiles.put("model.mustache", ".swift"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 77389ce3f907..2bab39d5b25c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -78,7 +78,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { public Swift4Codegen() { super(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) .securityFeatures(EnumSet.of( SecurityFeature.BasicAuth, @@ -97,7 +97,7 @@ public Swift4Codegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "swift"; modelTemplateFiles.put("model.mustache", ".swift"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java index c5daa1f54cd1..039d271fa053 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java @@ -95,7 +95,7 @@ public SwiftClientCodegen() { .stability(Stability.DEPRECATED) .build(); - featureSet = getFeatureSet().modify() + modifyFeatureSet(features -> features .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) .excludeGlobalFeatures( @@ -110,7 +110,7 @@ public SwiftClientCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - .build(); + ); outputFolder = "generated-code" + File.separator + "swift"; modelTemplateFiles.put("model.mustache", ".swift"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 99dfa285bbbd..6ebf1f8c5f9c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -71,9 +71,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public TypeScriptAngularClientCodegen() { super(); - featureSet = getFeatureSet().modify() - .includeDocumentationFeatures(DocumentationFeature.Readme) - .build(); + modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); this.outputFolder = "generated-code/typescript-angular"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 4d9f14383500..a441027bff06 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -44,9 +44,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public TypeScriptAxiosClientCodegen() { 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 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 9ea63beb2cf7..98c5d0d29db3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -48,9 +48,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege public TypeScriptFetchClientCodegen() { 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 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java index 75b91392fa1a..4c66e6dd5196 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java @@ -44,9 +44,7 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo public TypeScriptInversifyClientCodegen() { super(); - featureSet = getFeatureSet().modify() - .includeDocumentationFeatures(DocumentationFeature.Readme) - .build(); + modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); this.outputFolder = "generated-code/typescript-inversify"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java index 275af5c82e2d..c680840da7ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java @@ -40,9 +40,7 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg public TypeScriptJqueryClientCodegen() { super(); - featureSet = getFeatureSet().modify() - .includeDocumentationFeatures(DocumentationFeature.Readme) - .build(); + modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); modelTemplateFiles.put("model.mustache", ".ts"); apiTemplateFiles.put("api.mustache", ".ts"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java index 13a17b5f518c..624aa6af550e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java @@ -21,6 +21,8 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.FeatureSet; +import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -43,9 +45,7 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen public TypeScriptRxjsClientCodegen() { super(); - featureSet = getFeatureSet().modify() - .includeDocumentationFeatures(DocumentationFeature.Readme) - .build(); + modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); outputFolder = "generated-code/typescript-rxjs"; embeddedTemplateDir = templateDir = "typescript-rxjs"; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java index a4c32c3b7945..540bd180956b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java @@ -29,7 +29,7 @@ public class ProtobufSchemaCodegenTest { @Test public void testFeatureSet() { final ProtobufSchemaCodegen codegen = new ProtobufSchemaCodegen(); - FeatureSet featureSet = codegen.getFeatureSet(); + FeatureSet featureSet = codegen.getGeneratorMetadata().getFeatureSet(); Assert.assertTrue(featureSet.getWireFormatFeatures().contains(WireFormatFeature.PROTOBUF)); Assert.assertEquals(featureSet.getWireFormatFeatures().size(), 1);