Skip to content

Commit fd35e20

Browse files
Merge branch 'OpenAPITools:master' into single-request-parameter-equals-and-hashcode
2 parents 4a98d45 + 1eee603 commit fd35e20

File tree

2,284 files changed

+22629
-9979
lines changed

Some content is hidden

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

2,284 files changed

+22629
-9979
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ services:
3737

3838
# comment out the host table change to use the public petstore server
3939
addons:
40-
apt:
41-
sources:
42-
- ubuntu-toolchain-r-test
43-
packages:
44-
- g++-5
45-
chrome: stable
40+
#apt:
41+
# sources:
42+
# - ubuntu-toolchain-r-test
43+
# packages:
44+
# - g++-5
45+
#chrome: stable
4646
hosts:
4747
- petstore.swagger.io
4848

bin/configs/unmaintained/kotlin-jvm-retrofit2-coroutines.yaml renamed to bin/configs/kotlin-jvm-retrofit2-coroutines.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
generatorName: kotlin
2-
outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines
2+
outputDir: samples/client/petstore/kotlin-jvm-retrofit2-coroutines
33
library: jvm-retrofit2
4-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
55
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
66
additionalProperties:
77
serializationLibrary: gson
88
useCoroutines: "true"
99
artifactId: kotlin-petstore-coroutines-client
1010
serializableModel: "true"
1111
dateLibrary: java8
12+
useResponseAsReturnType: false

bin/utils/test_file_list.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
1111
sha256: 325fdd5d7e2c97790c0fb44f712ab7b2ba022d7e1a5b0056f47b07f342682b6d
1212
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
13-
sha256: e673d9928c8eb848262d0116fe0d28db832e128671a810a7c966d06d90cb9b63
13+
sha256: 67941355a0a27ed9ff9318b1caa103e78b81b9aff61b594b18be5cd2bb9f6591
1414
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java"
1515
sha256: 8b1b8f2a2ad00ccb090873a94a5f73e328b98317d2ec715f53bd7a1accb2a023
1616
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
@@ -55,6 +55,8 @@
5555
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
5656
- filename: "samples/client/petstore/java/feign/src/test/java/org/openapitools/client/JacksonTest.java"
5757
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
58+
- filename: "samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/JacksonTest.java"
59+
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
5860
# rust axum test files
5961
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
6062
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600

docs/faq-generators.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ Here is a working sample that put's together all of this.
494494
- The default project structure now follows the SPM (Swift Package Manager) structure. To revert to the old structure, set the `useSPMFileStructure` flag to `false`.
495495
- The former `{{projectName}}API` is now called `{{projectName}}APIConfiguration`.
496496
- You can now set a request interceptor and retrier by configuring `OpenAPIClient.shared.interceptor`, making authenticated requests easier to manage.
497+
- The protocol `JSONEncodable` was renamed to `ParameterConvertible`.
498+
- The flag `useJSONEncodable` was renamed to `useParameterConvertible`.
497499

498500
## TypeScript
499501

docs/generators/elixir.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4545
## LANGUAGE PRIMITIVES
4646

4747
<ul class="column-ul">
48-
<li>AnyType</li>
49-
<li>Atom</li>
50-
<li>Boolean</li>
51-
<li>Decimal</li>
52-
<li>Float</li>
53-
<li>Integer</li>
54-
<li>List</li>
55-
<li>Map</li>
56-
<li>PID</li>
57-
<li>String</li>
58-
<li>Tuple</li>
48+
<li>Date.t</li>
49+
<li>DateTime.t</li>
50+
<li>String.t</li>
5951
<li>any()</li>
52+
<li>binary()</li>
53+
<li>boolean()</li>
54+
<li>float()</li>
55+
<li>integer()</li>
56+
<li>list()</li>
6057
<li>map()</li>
58+
<li>nil</li>
59+
<li>number()</li>
6160
</ul>
6261

6362
## RESERVED WORDS
@@ -189,7 +188,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
189188
|BasicAuth|✓|OAS2,OAS3
190189
|ApiKey|✗|OAS2,OAS3
191190
|OpenIDConnect|✗|OAS3
192-
|BearerToken||OAS3
191+
|BearerToken||OAS3
193192
|OAuth2_Implicit|✓|OAS2,OAS3
194193
|OAuth2_Password|✗|OAS2,OAS3
195194
|OAuth2_ClientCredentials|✗|OAS2,OAS3

docs/generators/java-camel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
127127
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
128128
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null
129129
|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
130-
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
130+
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
131131
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
132132
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
133133

docs/generators/kotlin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3030
|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.| |false|
3131
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
3232
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
33-
|idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
33+
|idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
3434
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
3535
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
3636
|modelMutable|Create mutable models| |false|
@@ -50,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5050
|supportAndroidApiLevel25AndBelow|[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and below. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284| |false|
5151
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false|
5252
|useNonAsciiHeaders|Allow to use non-ascii headers with the okhttp library| |false|
53+
|useResponseAsReturnType|When using retrofit2 and coroutines, use `Response`&lt;`T`&gt; as return type instead of `T`.| |true|
5354
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false|
5455
|useSettingsGradle|Whether the project uses settings.gradle.| |false|
5556
|useSpringBoot3|Whether to use the Spring Boot 3 with the jvm-spring-webclient library.| |false|

docs/generators/spring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
120120
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
121121
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null
122122
|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
123-
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
123+
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
124124
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
125125
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
126126

docs/generators/swift6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5656
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
5757
|useClasses|Use final classes for models instead of structs (default: false)| |false|
5858
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
59-
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
59+
|useParameterConvertible|Make models conform to ParameterConvertible protocol (default: true)| |true|
6060
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null|
6161
|validatable|Make validation rules and validator for model properties (default: true)| |true|
6262

modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@ public class CodeGenMojo extends AbstractMojo {
116116
@Parameter(name = "mergedFileName", property = "openapi.generator.maven.plugin.mergedFileName", defaultValue = "_merged_spec")
117117
private String mergedFileName;
118118

119+
/**
120+
* Name that will appear in the info section of the merged spec
121+
*/
122+
@Parameter(name = "mergedFileInfoName", property = "openapi.generator.maven.plugin.mergedFileInfoName", defaultValue = "merged spec")
123+
private String mergedFileInfoName;
124+
125+
/**
126+
* Description that will appear in the info section of the merged spec
127+
*/
128+
@Parameter(name = "mergedFileInfoDescription", property = "openapi.generator.maven.plugin.mergedFileInfoDescription", defaultValue = "merged spec")
129+
private String mergedFileInfoDescription;
130+
131+
/**
132+
* Version that will appear in the info section of the merged spec
133+
*/
134+
@Parameter(name = "mergedFileInfoVersion", property = "openapi.generator.maven.plugin.mergedFileInfoVersion", defaultValue = "1.0.0")
135+
private String mergedFileInfoVersion;
136+
119137
/**
120138
* Git host, e.g. gitlab.com.
121139
*/
@@ -545,7 +563,8 @@ public void execute() throws MojoExecutionException {
545563
}
546564

547565
if (StringUtils.isNotBlank(inputSpecRootDirectory)) {
548-
inputSpec = new MergedSpecBuilder(inputSpecRootDirectory, mergedFileName)
566+
inputSpec = new MergedSpecBuilder(inputSpecRootDirectory, mergedFileName,
567+
mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion)
549568
.buildMergedSpec();
550569
LOGGER.info("Merge input spec would be used - {}", inputSpec);
551570
}

0 commit comments

Comments
 (0)