Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit e3dcb2f

Browse files
committed
Merge branch 'master' into cleanup-template-management
* master: Fix ruby deprecation error (OpenAPITools#6450) [Java][Feign] decommission 9.x support (OpenAPITools#6445) fix struct export in rust reqwest (OpenAPITools#6453) [Rust][reqwest] add tests to CI (OpenAPITools#6454) set pester version (OpenAPITools#6448) update datadog logo update groovy petstore samples add datadog as sponsor (OpenAPITools#6444) Migrate Groovy samples to oas3 (OpenAPITools#6435) [samples] Renerate Kotlin coroutines
2 parents 8faa776 + dc48cfd commit e3dcb2f

File tree

176 files changed

+321
-18141
lines changed

Some content is hidden

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

176 files changed

+321
-18141
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
4444
[![NamSor](https://openapi-generator.tech/img/companies/namsor.png)](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
4545
[![LightBow](https://openapi-generator.tech/img/companies/lightbow.png)](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
4646
[<img src="https://openapi-generator.tech/img/companies/docspring.png" width="128" height="128">](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
47-
47+
[<img src="https://openapi-generator.tech/img/companies/datadog.png" width="128" height="128">](https://datadoghq.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
4848

4949
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring
5050

@@ -579,6 +579,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
579579
- [Commencis](https://www.commencis.com/)
580580
- [Crossover Health](https://crossoverhealth.com/)
581581
- [Cupix](https://www.cupix.com/)
582+
- [Datadog](https://www.datadoghq.com)
582583
- [DB Systel](https://www.dbsystel.de)
583584
- [DocSpring](https://docspring.com/)
584585
- [dwango](https://dwango.co.jp/)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install:
3232
- git clone https://github.com/wing328/swagger-samples
3333
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
3434
- ps: $PSVersionTable.PSVersion
35-
- ps: Install-Module Pester -Force -Scope CurrentUser
35+
- ps: Install-Module Pester -Force -Scope CurrentUser -RequiredVersion 4.3.1
3636
build_script:
3737
- dotnet --info
3838
# build C# API client (netcore)

bin/groovy-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@"
30+
ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@"
3131
java $JAVA_OPTS -jar $executable $ags

bin/java-petstore-all.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# update java petstore clients for all supported http libraries
33

44
./bin/java-petstore-feign-10x.sh
5-
./bin/java-petstore-feign.sh
65
./bin/java-petstore-google-api-client.sh
76
./bin/java-petstore-jersey1.sh
87
./bin/java-petstore-jersey2-java8.sh

bin/java-petstore-feign-9x.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

bin/java-petstore-feign.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

bin/java-petstore-feign.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

bin/openapi3/groovy-petstore.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

bin/windows/groovy-petstore.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
2+
3+
If Not Exist %executable% (
4+
mvn clean package
5+
)
6+
7+
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8+
set ags=generate --artifact-id "groovy-petstore-client" -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g groovy -o samples\client\petstore\nim
9+
10+
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/java-petstore-all.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
call .\bin\windows\java-petstore-feign-10x.bat
2-
call .\bin\windows\java-petstore-feign.bat
32
call .\bin\windows\java-petstore-google-api-client.bat
43
call .\bin\windows\java-petstore-jersey1.bat
54
call .\bin\windows\java-petstore-jersey2-java8.bat

bin/windows/java-petstore-feign.bat

Lines changed: 0 additions & 10 deletions
This file was deleted.

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,9 @@ public void processOpts() {
237237
}
238238
additionalProperties.put(PLAY_VERSION, playVersion);
239239

240-
// OpenFeign
240+
// default to feign 10.x
241241
if (additionalProperties.containsKey(FEIGN_VERSION)) {
242-
this.setFeignVersion(additionalProperties.get(FEIGN_VERSION).toString());
243-
244-
if ("10.x".equals(feignVersion)) {
245-
additionalProperties.put("useFeign10", true);
246-
} else if ("9.x".equals(feignVersion)) {
247-
additionalProperties.put("useFeign10", false);
248-
once(LOGGER).warn("Feign 9.x support has been deprecated. Please use 10.x (default) instead.");
249-
} else {
250-
throw new RuntimeException("Ivalid feignOoption '{}'. Must be '10.x' or '9.x' (deprecated).");
251-
}
252-
} else {
253-
// default to feign 10.x
254-
additionalProperties.put("useFeign10", true);
242+
once(LOGGER).warn("feignVersion has been deprecated. 10.x is the default.");
255243
}
256244
additionalProperties.put(FEIGN_VERSION, feignVersion);
257245

modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Layout/SpaceInsideParens:
113113
# EnforcedStyle: single_quotes
114114

115115
# Detect hard tabs, no hard tabs.
116-
Layout/Tab:
116+
Layout/IndentationStyle:
117117
Enabled: true
118118

119119
# Blank lines should not have any spaces.

modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ impl {{{classname}}}Client {
2222

2323
{{#operations}}
2424
{{#operation}}
25-
{{#vendorExtensions.x-group-parameters}}
26-
{{#allParams}}
27-
{{#-first}}
28-
/// struct for passing parameters to the method `{{operationId}}`
29-
#[derive(Clone, Debug)]
30-
pub struct {{{operationIdCamelCase}}}Params {
31-
{{/-first}}
32-
{{#description}}
33-
/// {{{.}}}
34-
{{/description}}
35-
pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}String{{/isString}}{{#isUuid}}String{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{#hasMore}}, {{/hasMore}}
36-
{{#-last}}
37-
}
25+
{{#vendorExtensions.x-group-parameters}}
26+
{{#allParams}}
27+
{{#-first}}
28+
/// struct for passing parameters to the method `{{operationId}}`
29+
#[derive(Clone, Debug)]
30+
pub struct {{{classname}}}{{{operationIdCamelCase}}}Params {
31+
{{/-first}}
32+
{{#description}}
33+
/// {{{.}}}
34+
{{/description}}
35+
pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}String{{/isString}}{{#isUuid}}String{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{#hasMore}},{{/hasMore}}
36+
{{#-last}}
37+
}
3838

39-
{{/-last}}
40-
{{/allParams}}
41-
{{/vendorExtensions.x-group-parameters}}
39+
{{/-last}}
40+
{{/allParams}}
41+
{{/vendorExtensions.x-group-parameters}}
4242
{{/operation}}
4343
{{/operations}}
4444

4545
pub trait {{{classname}}} {
4646
{{#operations}}
4747
{{#operation}}
4848
{{#vendorExtensions.x-group-parameters}}
49-
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error>;
49+
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{classname}}}{{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error>;
5050
{{/vendorExtensions.x-group-parameters}}
5151
{{^vendorExtensions.x-group-parameters}}
5252
fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error>;
@@ -59,7 +59,7 @@ impl {{{classname}}} for {{{classname}}}Client {
5959
{{#operations}}
6060
{{#operation}}
6161
{{#vendorExtensions.x-group-parameters}}
62-
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error> {
62+
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{classname}}}{{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error> {
6363
// unbox the parameters
6464
{{#allParams}}
6565
let {{paramName}} = params.{{paramName}};

modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ pub fn urlencode<T: AsRef<str>>(s: T) -> String {
3535
mod {{{classFilename}}};
3636
{{#operations}}
3737
{{#operation}}
38-
{{#-last}}
38+
{{#-first}}
3939
pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client };
40-
{{/-last}}
40+
{{/-first}}
41+
{{#vendorExtensions.x-group-parameters}}
42+
{{#allParams}}
43+
{{#-first}}
44+
pub use self::{{{classFilename}}}::{ {{{classname}}}{{{operationIdCamelCase}}}Params };
45+
{{/-first}}
46+
{{/allParams}}
47+
{{/vendorExtensions.x-group-parameters}}
4148
{{/operation}}
4249
{{/operations}}
4350
{{/apis}}

pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@
772772
</property>
773773
</activation>
774774
<modules>
775-
<module>samples/client/petstore/java/feign</module>
775+
<module>samples/client/petstore/java/feign10x</module>
776776
</modules>
777777
</profile>
778778
<profile>
@@ -1206,6 +1206,7 @@
12061206
<module>samples/client/petstore/c</module>
12071207
<module>samples/client/petstore/cpp-qt5</module>
12081208
<module>samples/client/petstore/rust</module>
1209+
<module>samples/client/petstore/rust/reqwest/petstore</module>
12091210
<!--<module>samples/client/petstore/perl</module>-->
12101211
<module>samples/client/petstore/php/OpenAPIClient-php</module>
12111212
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
@@ -1260,7 +1261,6 @@
12601261
<module>samples/client/petstore/scala-httpclient</module>
12611262
<module>samples/client/petstore/scalaz</module>
12621263
<module>samples/client/petstore/clojure</module>
1263-
<module>samples/client/petstore/java/feign</module>
12641264
<module>samples/client/petstore/java/feign10x</module>
12651265
<module>samples/client/petstore/java/jersey1</module>
12661266
<module>samples/client/petstore/java/jersey2-java8</module>
@@ -1354,7 +1354,6 @@
13541354
<module>samples/client/petstore/dart-jaguar/flutter_petstore/openapi</module>
13551355
<module>samples/client/petstore/scala-akka</module>
13561356
<module>samples/client/petstore/scala-httpclient</module>
1357-
<module>samples/client/petstore/java/feign</module>
13581357
<module>samples/client/petstore/java/jersey1</module>
13591358
<module>samples/client/petstore/java/okhttp-gson</module>
13601359
<module>samples/client/petstore/java/retrofit</module>

samples/client/petstore/groovy/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ src/main/groovy/org/openapitools/api/PetApi.groovy
55
src/main/groovy/org/openapitools/api/StoreApi.groovy
66
src/main/groovy/org/openapitools/api/UserApi.groovy
77
src/main/groovy/org/openapitools/model/Category.groovy
8+
src/main/groovy/org/openapitools/model/InlineObject.groovy
9+
src/main/groovy/org/openapitools/model/InlineObject1.groovy
810
src/main/groovy/org/openapitools/model/ModelApiResponse.groovy
911
src/main/groovy/org/openapitools/model/Order.groovy
1012
src/main/groovy/org/openapitools/model/Pet.groovy

samples/client/petstore/groovy/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ Then, run:
3232

3333
```groovy
3434
def apiInstance = new PetApi()
35-
def body = new Pet() // Pet | Pet object that needs to be added to the store
35+
def pet = new Pet() // Pet | Pet object that needs to be added to the store
3636
37-
apiInstance.addPet(body)
37+
apiInstance.addPet(pet)
3838
{
3939
// on success
40-
println it
40+
def result = (Pet)it
41+
println result
42+
4143
}
4244
{
4345
// on failure

samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PetApi {
99
String versionPath = ""
1010
ApiUtils apiUtils = new ApiUtils();
1111

12-
def addPet ( Pet body, Closure onSuccess, Closure onFailure) {
12+
def addPet ( Pet pet, Closure onSuccess, Closure onFailure) {
1313
String resourcePath = "/pet"
1414

1515
// params
@@ -19,19 +19,19 @@ class PetApi {
1919
def contentType
2020

2121
// verify required params are set
22-
if (body == null) {
23-
throw new RuntimeException("missing required params body")
22+
if (pet == null) {
23+
throw new RuntimeException("missing required params pet")
2424
}
2525

2626

2727

2828
contentType = 'application/json';
29-
bodyParams = body
29+
bodyParams = pet
3030

3131

3232
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
3333
"POST", "",
34-
null )
34+
Pet.class )
3535

3636
}
3737

@@ -140,7 +140,7 @@ class PetApi {
140140

141141
}
142142

143-
def updatePet ( Pet body, Closure onSuccess, Closure onFailure) {
143+
def updatePet ( Pet pet, Closure onSuccess, Closure onFailure) {
144144
String resourcePath = "/pet"
145145

146146
// params
@@ -150,19 +150,19 @@ class PetApi {
150150
def contentType
151151

152152
// verify required params are set
153-
if (body == null) {
154-
throw new RuntimeException("missing required params body")
153+
if (pet == null) {
154+
throw new RuntimeException("missing required params pet")
155155
}
156156

157157

158158

159159
contentType = 'application/json';
160-
bodyParams = body
160+
bodyParams = pet
161161

162162

163163
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
164164
"PUT", "",
165-
null )
165+
Pet.class )
166166

167167
}
168168

0 commit comments

Comments
 (0)