Skip to content

Commit

Permalink
Merge branch 'master' into remove-deprecations-5.0
Browse files Browse the repository at this point in the history
* master: (71 commits)
  [PS] check if JSON properties is defined (#6419)
  Add C++ UE4  client generator (#6399)
  Add a link to the article in dev.to (#6421)
  typescript-axios anytype is not defined (#6335)
  [Java][jersey2] Make (de)serialization work for oneOf models, add convenience and comparison methods (#6323)
  Migrate OCaml petstore to use OAS v3 spec (#6348)
  [Python-experimental] Fix type error if oneof/anyof child schema is null type (#6387)
  [Python-server] Fix blueplanet 'file not found' error  (#6411)
  [nodejs] Fix deprecation notice when running sample nodejs script (#6412)
  [java-jersey2] Conditionally include http signature mustache template (#6413)
  [bug] Fix path provider bug on CI (#6409)
  decomission nodejs server generator (#6406)
  [Java] Generate valid code if no Authentication implementations present (#5788)
  update java jersey2 samples
  [Java] Fix mustache tag in pom template for HTTP signature (#6404)
  [Python-experimental] Rename from_server variable to json_variable_naming (#6390)
  Add a link to medium blog post (#6403)
  Clean up debug in test (#6398)
  readding bin/swift5-petstore-readonlyProperties.json
  remove ./bin/swift5-petstore-readonlyProperties.json
  ...
  • Loading branch information
jimschubert committed May 25, 2020
2 parents c59d5ac + f4897ea commit 18ce686
Show file tree
Hide file tree
Showing 3,581 changed files with 61,251 additions and 169,270 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 0 additions & 11 deletions CI/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,7 @@ workflows:
set -e
sh bin/swift4-all.sh
sh bin/swift5-all.sh
- [email protected]:
title: Run Swift4 tests
inputs:
- content: |
#!/usr/bin/env bash
set -e
./samples/client/petstore/swift4/swift4_test_all.sh
./samples/client/test/swift4/swift4_test_all.sh
- [email protected]:
title: Run Swift5 tests
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public void testGetAuthentications() {
}
}

@Ignore("There is no more basic auth in petstore security definitions")
@Test
public void testSetUsernameAndPassword() {
HttpBasicAuth auth = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public void testGetAuthentications() {
}
}

@Ignore("There is no more basic auth in petstore security definitions")
@Test
public void testSetUsernameAndPassword() {
HttpBasicAuth auth = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.io.BufferedWriter;
import java.io.File;
Expand Down Expand Up @@ -324,7 +326,7 @@ public void testFindPetsByTags() throws Exception {

api.updatePet(pet);

List<Pet> pets = api.findPetsByTags(Arrays.asList("friendly"));
Set<Pet> pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly")));
assertNotNull(pets);

boolean found = false;
Expand Down Expand Up @@ -396,15 +398,15 @@ public void testEqualsAndHashCode() {
assertTrue(pet1.hashCode() == pet1.hashCode());

pet2.setName("really-happy");
pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"));
pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")));
assertFalse(pet1.equals(pet2));
assertFalse(pet2.equals(pet1));
assertFalse(pet1.hashCode() == (pet2.hashCode()));
assertTrue(pet2.equals(pet2));
assertTrue(pet2.hashCode() == pet2.hashCode());

pet1.setName("really-happy");
pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"));
pet1.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")));
assertTrue(pet1.equals(pet2));
assertTrue(pet2.equals(pet1));
assertTrue(pet1.hashCode() == pet2.hashCode());
Expand All @@ -423,7 +425,7 @@ private Pet createPet() {

pet.setCategory(category);
pet.setStatus(Pet.StatusEnum.AVAILABLE);
List<String> photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2");
Set<String> photos = new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"));
pet.setPhotoUrls(photos);

return pet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public void testGetAuthentications() {
}
}

@Ignore("There is no more basic auth in petstore security definitions")
@Test
public void testSetUsernameAndPassword() {
HttpBasicAuth auth = null;
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,11 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2020-03-15 - [Load Testing Your API with Swagger/OpenAPI and k6](https://k6.io/blog/load-testing-your-api-with-swagger-openapi-and-k6)
- 2020-04-13 - [俺的【OAS】との向き合い方 (爆速でOpenAPIと友達になろう)](https://tech-blog.optim.co.jp/entry/2020/04/13/100000) in [OPTim Blog](https://tech-blog.optim.co.jp/)
- 2020-04-22 - [Introduction to OpenAPI Generator](https://nordicapis.com/introduction-to-openapi-generator/) by [Kristopher Sandoval](https://nordicapis.com/author/sandovaleffect/) in [Nordic APIs](https://nordicapis.com/)
- 2020-04-27 - [How we use Open API v3 specification to auto-generate API documentation, code-snippets and clients](https://medium.com/pdf-generator-api/how-we-use-open-api-v3-specification-to-auto-generate-api-documentation-code-snippets-and-clients-d127a3cea784) by [Tanel Tähepõld](https://medium.com/@tanel.tahepold)
- 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le)
- 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz)
- 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/)
- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried)

## [6 - About Us](#table-of-contents)

Expand All @@ -760,6 +764,7 @@ OpenAPI Generator core team members are contributors who have been making signif
* [@ackintosh](https://github.com/ackintosh) (2018/02) [:heart:](https://www.patreon.com/ackintosh/overview)
* [@jmini](https://github.com/jmini) (2018/04) [:heart:](https://www.patreon.com/jmini)
* [@etherealjoy](https://github.com/etherealjoy) (2019/06)
* [@spacether](https://github.com/spacether) (2020/05)

:heart: = Link to support the contributor directly

Expand All @@ -774,6 +779,7 @@ Here is a list of template creators:
* Bash: @bkryza
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
* C++ REST: @Danielku15
* C++ UE4: @Kahncode
* C# (.NET 2.0): @who
* C# (.NET Standard 1.3 ): @Gronsak
* C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)
Expand Down Expand Up @@ -817,6 +823,7 @@ Here is a list of template creators:
* Perl: @wing328 [:heart:](https://www.patreon.com/wing328)
* PHP (Guzzle): @baartosz
* PowerShell: @beatcracker
* PowerShell (refactored in 5.0.0): @wing328
* Python-experimental: @spacether
* R: @ramnov
* Ruby (Faraday): @meganemura @dkliban
Expand Down Expand Up @@ -885,6 +892,7 @@ Here is a list of template creators:
* AsciiDoc: @man-at-home
* HTML Doc 2: @jhitchcock
* Confluence Wiki: @jhitchcock
* PlantUML: @pburls
* Configuration
* Apache2: @stkrwork
* k6: @mostafa
Expand Down Expand Up @@ -936,7 +944,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) @shibayan (2020/02) |
| Clojure | |
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12) |
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) |
| Eiffel | @jvelilla (2017/09) |
| Elixir | @mrmstn (2018/12) |
| Elm | @eriktim (2018/09) |
Expand All @@ -955,8 +963,8 @@ If you want to join the committee, please kindly apply by sending an email to te
| OCaml | @cgensoul (2019/08) |
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) |
| PowerShell | |
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11) |
| PowerShell | @wing328 (2020/05) |
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) |
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) @paladinzh (2020/05) |
Expand Down
31 changes: 31 additions & 0 deletions bin/cpp-ue4-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/openapi-generator/src/main/resources/cpp-ue4 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-ue4 -o samples/client/petstore/cpp-ue4"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/erlang-petstore-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@"
ags="generate -t modules/openapi-generator/src/main/resources/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/erlang-petstore-proper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/erlang-proper --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-proper -o samples/client/petstore/erlang-proper $@"
ags="generate -t modules/openapi-generator/src/main/resources/erlang-proper --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-proper -o samples/client/petstore/erlang-proper $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/erlang-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/erlang-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@"
ags="generate -t modules/openapi-generator/src/main/resources/erlang-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/nodejs-express-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ 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/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server -Dservice $@"
ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/ocaml-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"

args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@"
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@"

echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
java $JAVA_OPTS -jar $executable $args
32 changes: 0 additions & 32 deletions bin/openapi3/erlang-petstore-client.sh

This file was deleted.

32 changes: 0 additions & 32 deletions bin/openapi3/erlang-petstore-server.sh

This file was deleted.

10 changes: 10 additions & 0 deletions bin/openapi3/kotlin-client-petstore-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh


./bin/openapi3/kotlin-client-petstore.sh
./bin/openapi3/kotlin-client-petstore-multiplatform.sh
./bin/openapi3/kotlin-client-petstore-nullable-required.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh

8 changes: 5 additions & 3 deletions bin/openapi3/kotlin-client-petstore-multiplatform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ then
mvn clean package
fi

samplePath="samples/openapi3/client/petstore/kotlin-multiplatform"

export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/openapi3/client/petstore/kotlin-multiplatform $@"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o $samplePath $@"

echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform"
rm -rf samples/openapi3/client/petstore/kotlin-multiplatform
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath

echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags
8 changes: 5 additions & 3 deletions bin/openapi3/kotlin-client-petstore-nullable-required.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ then
mvn clean package
fi

samplePath="samples/openapi3/client/petstore/kotlin-nullable-required"

export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o samples/openapi3/client/petstore/kotlin-nullable-required $@"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o $samplePath $@"

echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-nullable-required"
rm -rf samples/openapi3/client/petstore/kotlin-nullable-required
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath

echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags
Loading

0 comments on commit 18ce686

Please sign in to comment.