Skip to content

Commit

Permalink
Merge branch 'master' into cleanup-template-management
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jimschubert committed May 28, 2020
2 parents 8faa776 + dc48cfd commit e3dcb2f
Show file tree
Hide file tree
Showing 176 changed files with 321 additions and 18,141 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
[![NamSor](https://openapi-generator.tech/img/companies/namsor.png)](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
[![LightBow](https://openapi-generator.tech/img/companies/lightbow.png)](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
[<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)

[<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)

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

Expand Down Expand Up @@ -579,6 +579,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Commencis](https://www.commencis.com/)
- [Crossover Health](https://crossoverhealth.com/)
- [Cupix](https://www.cupix.com/)
- [Datadog](https://www.datadoghq.com)
- [DB Systel](https://www.dbsystel.de)
- [DocSpring](https://docspring.com/)
- [dwango](https://dwango.co.jp/)
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install:
- git clone https://github.com/wing328/swagger-samples
- 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"
- ps: $PSVersionTable.PSVersion
- ps: Install-Module Pester -Force -Scope CurrentUser
- ps: Install-Module Pester -Force -Scope CurrentUser -RequiredVersion 4.3.1
build_script:
- dotnet --info
# build C# API client (netcore)
Expand Down
2 changes: 1 addition & 1 deletion bin/groovy-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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 $@"
java $JAVA_OPTS -jar $executable $ags
1 change: 0 additions & 1 deletion bin/java-petstore-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# update java petstore clients for all supported http libraries

./bin/java-petstore-feign-10x.sh
./bin/java-petstore-feign.sh
./bin/java-petstore-google-api-client.sh
./bin/java-petstore-jersey1.sh
./bin/java-petstore-jersey2-java8.sh
Expand Down
5 changes: 0 additions & 5 deletions bin/java-petstore-feign-9x.json

This file was deleted.

5 changes: 0 additions & 5 deletions bin/java-petstore-feign.json

This file was deleted.

40 changes: 0 additions & 40 deletions bin/java-petstore-feign.sh

This file was deleted.

31 changes: 0 additions & 31 deletions bin/openapi3/groovy-petstore.sh

This file was deleted.

10 changes: 10 additions & 0 deletions bin/windows/groovy-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
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

java %JAVA_OPTS% -jar %executable% %ags%
1 change: 0 additions & 1 deletion bin/windows/java-petstore-all.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
call .\bin\windows\java-petstore-feign-10x.bat
call .\bin\windows\java-petstore-feign.bat
call .\bin\windows\java-petstore-google-api-client.bat
call .\bin\windows\java-petstore-jersey1.bat
call .\bin\windows\java-petstore-jersey2-java8.bat
Expand Down
10 changes: 0 additions & 10 deletions bin/windows/java-petstore-feign.bat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,9 @@ public void processOpts() {
}
additionalProperties.put(PLAY_VERSION, playVersion);

// OpenFeign
// default to feign 10.x
if (additionalProperties.containsKey(FEIGN_VERSION)) {
this.setFeignVersion(additionalProperties.get(FEIGN_VERSION).toString());

if ("10.x".equals(feignVersion)) {
additionalProperties.put("useFeign10", true);
} else if ("9.x".equals(feignVersion)) {
additionalProperties.put("useFeign10", false);
once(LOGGER).warn("Feign 9.x support has been deprecated. Please use 10.x (default) instead.");
} else {
throw new RuntimeException("Ivalid feignOoption '{}'. Must be '10.x' or '9.x' (deprecated).");
}
} else {
// default to feign 10.x
additionalProperties.put("useFeign10", true);
once(LOGGER).warn("feignVersion has been deprecated. 10.x is the default.");
}
additionalProperties.put(FEIGN_VERSION, feignVersion);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Layout/SpaceInsideParens:
# EnforcedStyle: single_quotes

# Detect hard tabs, no hard tabs.
Layout/Tab:
Layout/IndentationStyle:
Enabled: true

# Blank lines should not have any spaces.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ impl {{{classname}}}Client {

{{#operations}}
{{#operation}}
{{#vendorExtensions.x-group-parameters}}
{{#allParams}}
{{#-first}}
/// struct for passing parameters to the method `{{operationId}}`
#[derive(Clone, Debug)]
pub struct {{{operationIdCamelCase}}}Params {
{{/-first}}
{{#description}}
/// {{{.}}}
{{/description}}
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}}
{{#-last}}
}
{{#vendorExtensions.x-group-parameters}}
{{#allParams}}
{{#-first}}
/// struct for passing parameters to the method `{{operationId}}`
#[derive(Clone, Debug)]
pub struct {{{classname}}}{{{operationIdCamelCase}}}Params {
{{/-first}}
{{#description}}
/// {{{.}}}
{{/description}}
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}}
{{#-last}}
}

{{/-last}}
{{/allParams}}
{{/vendorExtensions.x-group-parameters}}
{{/-last}}
{{/allParams}}
{{/vendorExtensions.x-group-parameters}}
{{/operation}}
{{/operations}}

pub trait {{{classname}}} {
{{#operations}}
{{#operation}}
{{#vendorExtensions.x-group-parameters}}
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error>;
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{classname}}}{{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error>;
{{/vendorExtensions.x-group-parameters}}
{{^vendorExtensions.x-group-parameters}}
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>;
Expand All @@ -59,7 +59,7 @@ impl {{{classname}}} for {{{classname}}}Client {
{{#operations}}
{{#operation}}
{{#vendorExtensions.x-group-parameters}}
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error> {
fn {{{operationId}}}(&self{{#allParams}}{{#-first}}, params: {{{classname}}}{{{operationIdCamelCase}}}Params{{/-first}}{{/allParams}}) -> Result<{{^returnType}}(){{/returnType}}{{#returnType}}{{{returnType}}}{{/returnType}}, Error> {
// unbox the parameters
{{#allParams}}
let {{paramName}} = params.{{paramName}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ pub fn urlencode<T: AsRef<str>>(s: T) -> String {
mod {{{classFilename}}};
{{#operations}}
{{#operation}}
{{#-last}}
{{#-first}}
pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client };
{{/-last}}
{{/-first}}
{{#vendorExtensions.x-group-parameters}}
{{#allParams}}
{{#-first}}
pub use self::{{{classFilename}}}::{ {{{classname}}}{{{operationIdCamelCase}}}Params };
{{/-first}}
{{/allParams}}
{{/vendorExtensions.x-group-parameters}}
{{/operation}}
{{/operations}}
{{/apis}}
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
</property>
</activation>
<modules>
<module>samples/client/petstore/java/feign</module>
<module>samples/client/petstore/java/feign10x</module>
</modules>
</profile>
<profile>
Expand Down Expand Up @@ -1206,6 +1206,7 @@
<module>samples/client/petstore/c</module>
<module>samples/client/petstore/cpp-qt5</module>
<module>samples/client/petstore/rust</module>
<module>samples/client/petstore/rust/reqwest/petstore</module>
<!--<module>samples/client/petstore/perl</module>-->
<module>samples/client/petstore/php/OpenAPIClient-php</module>
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
Expand Down Expand Up @@ -1260,7 +1261,6 @@
<module>samples/client/petstore/scala-httpclient</module>
<module>samples/client/petstore/scalaz</module>
<module>samples/client/petstore/clojure</module>
<module>samples/client/petstore/java/feign</module>
<module>samples/client/petstore/java/feign10x</module>
<module>samples/client/petstore/java/jersey1</module>
<module>samples/client/petstore/java/jersey2-java8</module>
Expand Down Expand Up @@ -1354,7 +1354,6 @@
<module>samples/client/petstore/dart-jaguar/flutter_petstore/openapi</module>
<module>samples/client/petstore/scala-akka</module>
<module>samples/client/petstore/scala-httpclient</module>
<module>samples/client/petstore/java/feign</module>
<module>samples/client/petstore/java/jersey1</module>
<module>samples/client/petstore/java/okhttp-gson</module>
<module>samples/client/petstore/java/retrofit</module>
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/groovy/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ src/main/groovy/org/openapitools/api/PetApi.groovy
src/main/groovy/org/openapitools/api/StoreApi.groovy
src/main/groovy/org/openapitools/api/UserApi.groovy
src/main/groovy/org/openapitools/model/Category.groovy
src/main/groovy/org/openapitools/model/InlineObject.groovy
src/main/groovy/org/openapitools/model/InlineObject1.groovy
src/main/groovy/org/openapitools/model/ModelApiResponse.groovy
src/main/groovy/org/openapitools/model/Order.groovy
src/main/groovy/org/openapitools/model/Pet.groovy
Expand Down
8 changes: 5 additions & 3 deletions samples/client/petstore/groovy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ Then, run:

```groovy
def apiInstance = new PetApi()
def body = new Pet() // Pet | Pet object that needs to be added to the store
def pet = new Pet() // Pet | Pet object that needs to be added to the store
apiInstance.addPet(body)
apiInstance.addPet(pet)
{
// on success
println it
def result = (Pet)it
println result
}
{
// on failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PetApi {
String versionPath = ""
ApiUtils apiUtils = new ApiUtils();

def addPet ( Pet body, Closure onSuccess, Closure onFailure) {
def addPet ( Pet pet, Closure onSuccess, Closure onFailure) {
String resourcePath = "/pet"

// params
Expand All @@ -19,19 +19,19 @@ class PetApi {
def contentType

// verify required params are set
if (body == null) {
throw new RuntimeException("missing required params body")
if (pet == null) {
throw new RuntimeException("missing required params pet")
}



contentType = 'application/json';
bodyParams = body
bodyParams = pet


apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"POST", "",
null )
Pet.class )

}

Expand Down Expand Up @@ -140,7 +140,7 @@ class PetApi {

}

def updatePet ( Pet body, Closure onSuccess, Closure onFailure) {
def updatePet ( Pet pet, Closure onSuccess, Closure onFailure) {
String resourcePath = "/pet"

// params
Expand All @@ -150,19 +150,19 @@ class PetApi {
def contentType

// verify required params are set
if (body == null) {
throw new RuntimeException("missing required params body")
if (pet == null) {
throw new RuntimeException("missing required params pet")
}



contentType = 'application/json';
bodyParams = body
bodyParams = pet


apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"PUT", "",
null )
Pet.class )

}

Expand Down
Loading

0 comments on commit e3dcb2f

Please sign in to comment.