Skip to content

Commit d4ca25d

Browse files
committed
Merge branch 'noproxy' into kubernetes
2 parents b15da73 + f4402ef commit d4ca25d

1,848 files changed

Lines changed: 23288 additions & 59494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mvn/extensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<extension>
44
<groupId>com.gradle</groupId>
55
<artifactId>develocity-maven-extension</artifactId>
6-
<version>1.21.6</version>
6+
<version>1.23.2</version>
77
</extension>
88
<extension>
99
<groupId>com.gradle</groupId>
1010
<artifactId>common-custom-user-data-maven-extension</artifactId>
11-
<version>1.12.5</version>
11+
<version>2.0.2</version>
1212
</extension>
1313
</extensions>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Stable releases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
77
[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE)
88
[![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator)
9-
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-2wmkn4s8g-n19PJ99Y6Vei74WMUIehQA)
9+
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-36ucx4ybl-jYrN6euoYn6zxXNZdldoZA)
1010
[![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator)
1111
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/OpenAPITools/openapi-generator)
1212
[![Conan Center](https://shields.io/conan/v/openapi-generator)](https://conan.io/center/recipes/openapi-generator)

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "FAQ: General"
77

88
Yes, we use Slack.
99

10-
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-2wmkn4s8g-n19PJ99Y6Vei74WMUIehQA)
10+
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-36ucx4ybl-jYrN6euoYn6zxXNZdldoZA)
1111

1212
## What is the governance structure of the OpenAPI Generator project?
1313

docs/generators/csharp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4444
|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools|
4545
|packageTags|Tags to identify the package| |null|
4646
|packageVersion|C# package version.| |1.0.0|
47-
|releaseNote|Release note, default to 'Minor update'.| |Minor update|
4847
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
4948
|sourceFolder|source folder for generated code| |src|
5049
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 12 May 2026)</dd></dl>|net9.0|

docs/generators/java-microprofile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
101101
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
102102
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
103103
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
104-
|useSingleRequestParameter|Setting this property to &quot;true&quot; will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to &quot;static&quot; does the same as &quot;true&quot;, but also makes the generated arguments class static with single parameter instantiation.| |false|
104+
|useSingleRequestParameter|Setting this property to &quot;true&quot; will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to &quot;static&quot; does the same as &quot;true&quot;, but also makes the generated arguments class static with single parameter instantiation.| |false|
105105
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
106106
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
107107
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

docs/generators/java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
101101
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
102102
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
103103
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
104-
|useSingleRequestParameter|Setting this property to &quot;true&quot; will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to &quot;static&quot; does the same as &quot;true&quot;, but also makes the generated arguments class static with single parameter instantiation.| |false|
104+
|useSingleRequestParameter|Setting this property to &quot;true&quot; will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to &quot;static&quot; does the same as &quot;true&quot;, but also makes the generated arguments class static with single parameter instantiation.| |false|
105105
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
106106
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
107107
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
117117
additionalProperties.set(generate.additionalProperties)
118118
serverVariables.set(generate.serverVariables)
119119
languageSpecificPrimitives.set(generate.languageSpecificPrimitives)
120+
openapiGeneratorIgnoreList.set(generate.openapiGeneratorIgnoreList)
120121
importMappings.set(generate.importMappings)
121122
schemaMappings.set(generate.schemaMappings)
122123
inlineSchemaNameMappings.set(generate.inlineSchemaNameMappings)

modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskDslTest.kt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,4 +570,55 @@ class GenerateTaskDslTest : TestBase() {
570570
"Dry run results message is missing."
571571
)
572572
}
573+
574+
@Test
575+
fun `openapiGenerate should set openapiGeneratorIgnoreList option`() {
576+
// Arrange
577+
val projectFiles = mapOf(
578+
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml")
579+
)
580+
withProject(
581+
"""
582+
plugins {
583+
id 'org.openapi.generator'
584+
}
585+
openApiGenerate {
586+
generatorName = "kotlin"
587+
inputSpec = file("spec.yaml").absolutePath
588+
outputDir = file("build/kotlin").absolutePath
589+
apiPackage = "org.openapitools.example.api"
590+
invokerPackage = "org.openapitools.example.invoker"
591+
modelPackage = "org.openapitools.example.model"
592+
configOptions = [
593+
dateLibrary: "java8"
594+
]
595+
openapiGeneratorIgnoreList = ["README.md"]
596+
}
597+
""".trimIndent(),
598+
projectFiles
599+
)
600+
601+
// Act
602+
val result = GradleRunner.create()
603+
.withProjectDir(temp)
604+
.withArguments("openApiGenerate")
605+
.withPluginClasspath()
606+
.build()
607+
608+
// Assert
609+
assertTrue(
610+
result.output.contains("Successfully generated code to"),
611+
"User friendly generate notice is missing."
612+
)
613+
614+
assertTrue(
615+
"README.md" !in File(temp, "build/kotlin/").list(),
616+
"README.md should not be generated when it is in the openapiGeneratorIgnoreList."
617+
)
618+
619+
assertEquals(
620+
TaskOutcome.SUCCESS, result.task(":openApiGenerate")?.outcome,
621+
"Expected a successful run, but found ${result.task(":openApiGenerate")?.outcome}"
622+
)
623+
}
573624
}

modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,7 @@ private void gatherInlineModels(Schema schema, String modelPrefix) {
418418
if (schema.getAllOf().size() == 1) {
419419
// handle earlier in this function when looping through properties
420420
} else if (schema.getAllOf().size() > 1) {
421-
// Check if there is only one "non metadata" schema.
422-
// For example, there may be an `description` only schema that is used to override the descrption.
423-
// In these cases, we can simply discard those schemas.
424-
List<Schema> nonMetadataOnlySchemas = (List<Schema>) schema.getAllOf().stream()
425-
.filter(v -> ModelUtils.isMetadataOnlySchema((Schema) v))
426-
.collect(Collectors.toList());
427-
428-
if (nonMetadataOnlySchemas.size() == 1) {
429-
schema.setAllOf(nonMetadataOnlySchemas);
430-
} else {
431-
LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName());
432-
}
421+
LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName());
433422
} else {
434423
LOGGER.error("allOf schema `{}` contains no items.", schema.getName());
435424
}

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,52 @@ protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> v
851851
}
852852
}
853853

854+
protected void refactorAllOfWithMetadataOnlySchemas(Schema schema) {
855+
if (schema.getAllOf() == null) {
856+
return;
857+
}
858+
859+
// Check if there are metadata schemas.
860+
// For example, there may be an `description` only schema that is used to override the descrption.
861+
List<Schema> nonMetadataOnlySchemas = new ArrayList<>();
862+
List<Schema> metadataOnlySchemas = new ArrayList<>();
863+
864+
for (Object s: schema.getAllOf()) {
865+
if (s instanceof Schema) {
866+
if (ModelUtils.isMetadataOnlySchema((Schema) s)) {
867+
metadataOnlySchemas.add((Schema) s);
868+
} else {
869+
nonMetadataOnlySchemas.add((Schema) s);
870+
}
871+
}
872+
}
873+
874+
// ReferenceNumber:
875+
// allOf:
876+
// - $ref: '#/components/schemas/IEAN8'
877+
// - description: Product Ref
878+
// - example: IEAN1234
879+
//
880+
// becomes the following after the following code block
881+
//
882+
// ReferenceNumber:
883+
// allOf:
884+
// - $ref: '#/components/schemas/IEAN8'
885+
// description: Product Ref
886+
// example: IEAN1234
887+
//
888+
// which can be further processed by the generator
889+
if (nonMetadataOnlySchemas.size() > 0) {
890+
// keep the non metadata schema(s)
891+
schema.setAllOf(nonMetadataOnlySchemas);
892+
893+
// copy metadata to the allOf schema
894+
for (Schema metadataOnlySchema: metadataOnlySchemas) {
895+
ModelUtils.copyMetadata(metadataOnlySchema, schema);
896+
}
897+
}
898+
}
899+
854900
/*
855901
* Remove unsupported schemas (e.g. if, then) from allOf.
856902
*
@@ -882,6 +928,8 @@ protected void removeUnsupportedSchemasFromAllOf(Schema schema) {
882928
protected Schema normalizeAllOf(Schema schema, Set<Schema> visitedSchemas) {
883929
removeUnsupportedSchemasFromAllOf(schema);
884930

931+
refactorAllOfWithMetadataOnlySchemas(schema);
932+
885933
if (schema.getAllOf() == null) {
886934
return schema;
887935
}

0 commit comments

Comments
 (0)