Skip to content

Commit 5b95a14

Browse files
authored
Merge branch 'master' into feature/spring_7_webclient_compatibility
2 parents bb33136 + dc0d5c6 commit 5b95a14

415 files changed

Lines changed: 3685 additions & 836 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.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- 'samples/client/petstore/java/**'
77
- samples/client/petstore/jaxrs-cxf-client/**
8+
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
89
- samples/client/petstore/java-micronaut-client/**
910
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
1011
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -27,6 +28,7 @@ on:
2728
paths:
2829
- 'samples/client/petstore/java/**'
2930
- samples/client/petstore/jaxrs-cxf-client/**
31+
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
3032
- samples/client/petstore/java-micronaut-client/**
3133
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
3234
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -54,6 +56,7 @@ jobs:
5456
matrix:
5557
sample:
5658
# clients
59+
- samples/client/petstore/jaxrs-cxf-client-swagger2
5760
- samples/client/petstore/jaxrs-cxf-client
5861
- samples/client/petstore/java/native
5962
- samples/client/petstore/java/native-async
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
generatorName: jaxrs-cxf-client
2+
outputDir: samples/client/petstore/jaxrs-cxf-client-swagger2
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf
5+
additionalProperties:
6+
artifactId: jaxrs-cxf-petstore-swagger2
7+
documentationProvider: swagger2
8+
annotationLibrary: swagger2

docs/generators/jaxrs-cxf-client.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2222
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2323
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2424
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
25+
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
2526
|apiPackage|package for generated api classes| |org.openapitools.api|
2627
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
2728
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-client|
@@ -39,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3940
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
4041
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
4142
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
43+
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
4244
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
4345
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
4446
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

docs/generators/jaxrs-cxf-extended.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2323
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2424
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2525
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
26+
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
2627
|apiPackage|package for generated api classes| |org.openapitools.api|
2728
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
2829
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4041
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
4142
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
4243
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
44+
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
4345
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
4446
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
4547
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

docs/generators/jaxrs-cxf.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2323
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2424
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
2525
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
26+
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
2627
|apiPackage|package for generated api classes| |org.openapitools.api|
2728
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
2829
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4041
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
4142
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
4243
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
44+
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
4345
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
4446
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
4547
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

modules/openapi-generator-maven-plugin/examples/java-client.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@
217217
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
218218
<swagger-annotations-version>2.2.16</swagger-annotations-version>
219219
<jersey-version>2.35</jersey-version>
220-
<jackson-version>2.17.1</jackson-version>
221-
<jackson-databind-version>2.17.1</jackson-databind-version>
222-
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
220+
<jackson-version>2.19.2</jackson-version>
221+
<jackson-databind-version>2.19.2</jackson-databind-version>
222+
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
223223
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
224224
<junit-version>4.13.2</junit-version>
225225
<scribejava-apis-version>8.3.3</scribejava-apis-version>

modules/openapi-generator-maven-plugin/examples/kotlin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@
232232
<properties>
233233
<swagger-annotations-version>1.5.8</swagger-annotations-version>
234234
<jersey-version>2.27</jersey-version>
235-
<jackson-version>2.15.2</jackson-version>
236-
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
235+
<jackson-version>2.19.2</jackson-version>
236+
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
237237
<jodatime-version>2.7</jodatime-version>
238238
<maven-plugin-version>1.0.0</maven-plugin-version>
239239
<junit-version>4.13.2</junit-version>

modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<properties>
1616
<swagger-annotations-version>1.5.8</swagger-annotations-version>
1717
<jersey-version>2.35</jersey-version>
18-
<jackson-version>2.17.1</jackson-version>
19-
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
18+
<jackson-version>2.19.2</jackson-version>
19+
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
2020
<jodatime-version>2.7</jodatime-version>
2121
<maven-plugin-version>1.0.0</maven-plugin-version>
2222
<junit-version>5.10.2</junit-version>

modules/openapi-generator-maven-plugin/examples/spring.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<dependency>
112112
<groupId>org.openapitools</groupId>
113113
<artifactId>jackson-databind-nullable</artifactId>
114-
<version>0.2.6</version>
114+
<version>0.2.7</version>
115115
</dependency>
116116
<!-- Bean Validation API support -->
117117
<dependency>

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.openapitools.codegen.languages;
1919

2020
import io.swagger.v3.oas.models.Operation;
21+
import io.swagger.v3.oas.models.media.Schema;
2122
import lombok.Getter;
2223
import lombok.Setter;
2324
import org.openapitools.codegen.*;
@@ -115,6 +116,20 @@ public String getName() {
115116
return "jaxrs-cxf-client";
116117
}
117118

119+
@Override
120+
public List<DocumentationProvider> supportedDocumentationProvider() {
121+
return List.of(DocumentationProvider.NONE, DocumentationProvider.SWAGGER1, DocumentationProvider.SWAGGER2);
122+
}
123+
124+
@Override
125+
public List<AnnotationLibrary> supportedAnnotationLibraries() {
126+
return List.of(AnnotationLibrary.NONE, AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER2);
127+
}
128+
129+
@Override
130+
public DocumentationProvider defaultDocumentationProvider() {
131+
return DocumentationProvider.SWAGGER1;
132+
}
118133

119134
@Override
120135
public CodegenType getTag() {
@@ -127,11 +142,19 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
127142
co.subresourceOperation = !co.path.isEmpty();
128143
}
129144

145+
@Override
146+
public CodegenModel fromModel(String name, Schema model) {
147+
CodegenModel m = super.fromModel(name, model);
148+
m.imports.remove("ApiModel");
149+
return m;
150+
}
151+
130152
@Override
131153
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
132154
super.postProcessModelProperty(model, property);
133155
model.imports.remove("ApiModelProperty");
134156
model.imports.remove("ApiModel");
157+
model.imports.remove("JsonTypeName");
135158

136159
if (jackson) {
137160
//Add jackson imports when model has inner enum

0 commit comments

Comments
 (0)