Skip to content

Commit 8629c7f

Browse files
authored
Merge branch 'OpenAPITools:master' into feature/CBR-python-pydantic-v1-secret-str
2 parents 331c04a + 216ba30 commit 8629c7f

File tree

459 files changed

+10715
-2777
lines changed

Some content is hidden

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

459 files changed

+10715
-2777
lines changed

.github/workflows/samples-java-client-jdk11.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ jobs:
6363
- samples/client/petstore/java/rest-assured
6464
- samples/client/petstore/java/rest-assured-jackson
6565
- samples/client/petstore/java/microprofile-rest-client
66+
- samples/client/petstore/java/microprofile-rest-client-mutiny
6667
- samples/client/petstore/java/microprofile-rest-client-3.0
6768
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
6869
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
70+
- samples/client/petstore/java/microprofile-rest-client-3.0-mutiny
6971
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
7072
- samples/client/petstore/java/apache-httpclient
7173
- samples/client/petstore/java/feign
74+
- samples/client/petstore/java/feign-no-nullable
7275
- samples/client/petstore/java/okhttp-gson-awsv4signature
7376
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters
7477
- samples/openapi3/client/petstore/java/native

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-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g)
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-2uoef5v0g-XGwo8~2oJ3EoziDSO1CmdQ)
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)

bin/configs/java-feign-no-nullable.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/Java
66
additionalProperties:
77
booleanGetterPrefix: is
88
artifactId: petstore-feign-no-nullable
9-
hideGenerationTimestamp: "true"
9+
hideGenerationTimestamp: true
1010
additionalModelTypeAnnotations: '@javax.annotation.concurrent.Immutable'
11-
openApiNullable: "false"
11+
openApiNullable: false
12+
useReflectionEqualsHashCode: true
13+
annotationLibrary: "swagger1"

bin/configs/java-jersey2-8.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ additionalProperties:
1111
useOneOfDiscriminatorLookup: true
1212
disallowAdditionalPropertiesIfNotPresent: false
1313
gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
14-
failOnUnknownProperties: true
14+
failOnUnknownProperties: true
15+
useReflectionEqualsHashCode: true

bin/configs/java-jersey3.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ additionalProperties:
1212
useOneOfDiscriminatorLookup: true
1313
disallowAdditionalPropertiesIfNotPresent: false
1414
gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
15-
failOnUnknownProperties: true
15+
failOnUnknownProperties: true
16+
useReflectionEqualsHashCode: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: java
2+
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-mutiny
3+
library: microprofile
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/Java
6+
additionalProperties:
7+
artifactId: microprofile-rest-client-3-mutiny
8+
configKey: petstore
9+
microprofileRestClientVersion: "3.0"
10+
microprofileMutiny: true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
generatorName: java
2+
outputDir: samples/client/petstore/java/microprofile-rest-client-mutiny
3+
library: microprofile
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/Java
6+
additionalProperties:
7+
artifactId: microprofile-rest-client-mutiny
8+
configKeyFromClassName: true
9+
microprofileMutiny: true

bin/configs/java-native.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ additionalProperties:
77
artifactId: petstore-native
88
hideGenerationTimestamp: "true"
99
generateBuilders: true
10+
useReflectionEqualsHashCode: "true"

bin/configs/java-okhttp-gson.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ parameterNameMappings:
1111
type_: typeWithUnderscore
1212
additionalProperties:
1313
artifactId: petstore-okhttp-gson
14-
hideGenerationTimestamp: "true"
15-
useOneOfDiscriminatorLookup: "true"
14+
hideGenerationTimestamp: true
15+
useOneOfDiscriminatorLookup: true
1616
disallowAdditionalPropertiesIfNotPresent: false
17+
useReflectionEqualsHashCode:: true
1718
enumNameMappings:
1819
s: LOWER_CASE_S
1920
S: UPPER_CASE_S

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,16 @@ private Schema normalizeAllOfWithProperties(Schema schema, Set<Schema> visitedSc
755755
return schema;
756756
}
757757

758+
// process rule to refactor properties into allOf sub-schema
759+
schema = processRefactorAllOfWithPropertiesOnly(schema);
760+
758761
for (Object item : schema.getAllOf()) {
759762
if (!(item instanceof Schema)) {
760763
throw new RuntimeException("Error! allOf schema is not of the type Schema: " + item);
761764
}
762765
// normalize allOf sub schemas one by one
763766
normalizeSchema((Schema) item, visitedSchemas);
764767
}
765-
// process rules here
766-
schema = processRefactorAllOfWithPropertiesOnly(schema);
767768

768769
return schema;
769770
}
@@ -1325,9 +1326,8 @@ private Schema processRefactorAllOfWithPropertiesOnly(Schema schema) {
13251326
schema.setTitle(null);
13261327

13271328
// at this point the schema becomes a simple allOf (no properties) with an additional schema containing
1328-
// the properties
1329-
1330-
return schema;
1329+
// the properties. Normalize it before returning.
1330+
return normalizeSchema(schema, new HashSet<>());
13311331
}
13321332

13331333
/**

0 commit comments

Comments
 (0)