Skip to content

Commit 18ce686

Browse files
committed
Merge branch 'master' into remove-deprecations-5.0
* 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 ...
2 parents c59d5ac + f4897ea commit 18ce686

File tree

3,581 files changed

+61251
-169270
lines changed

Some content is hidden

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

3,581 files changed

+61251
-169270
lines changed

CI/bitrise.yml

-11
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ workflows:
3838
3939
set -e
4040
41-
sh bin/swift4-all.sh
4241
sh bin/swift5-all.sh
43-
- script@1.1.5:
44-
title: Run Swift4 tests
45-
inputs:
46-
- content: |
47-
#!/usr/bin/env bash
48-
49-
set -e
50-
51-
./samples/client/petstore/swift4/swift4_test_all.sh
52-
./samples/client/test/swift4/swift4_test_all.sh
5342
- script@1.1.5:
5443
title: Run Swift5 tests
5544
inputs:

CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public void testGetAuthentications() {
122122
}
123123
}
124124

125-
@Ignore("There is no more basic auth in petstore security definitions")
126125
@Test
127126
public void testSetUsernameAndPassword() {
128127
HttpBasicAuth auth = null;

CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public void testGetAuthentications() {
122122
}
123123
}
124124

125-
@Ignore("There is no more basic auth in petstore security definitions")
126125
@Test
127126
public void testSetUsernameAndPassword() {
128127
HttpBasicAuth auth = null;

CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
import java.util.concurrent.CountDownLatch;
2727
import java.util.concurrent.TimeUnit;
2828
import java.util.HashMap;
29+
import java.util.HashSet;
2930
import java.util.List;
3031
import java.util.Map;
32+
import java.util.Set;
3133
import java.util.concurrent.ThreadLocalRandom;
3234
import java.io.BufferedWriter;
3335
import java.io.File;
@@ -324,7 +326,7 @@ public void testFindPetsByTags() throws Exception {
324326

325327
api.updatePet(pet);
326328

327-
List<Pet> pets = api.findPetsByTags(Arrays.asList("friendly"));
329+
Set<Pet> pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly")));
328330
assertNotNull(pets);
329331

330332
boolean found = false;
@@ -396,15 +398,15 @@ public void testEqualsAndHashCode() {
396398
assertTrue(pet1.hashCode() == pet1.hashCode());
397399

398400
pet2.setName("really-happy");
399-
pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"));
401+
pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")));
400402
assertFalse(pet1.equals(pet2));
401403
assertFalse(pet2.equals(pet1));
402404
assertFalse(pet1.hashCode() == (pet2.hashCode()));
403405
assertTrue(pet2.equals(pet2));
404406
assertTrue(pet2.hashCode() == pet2.hashCode());
405407

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

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

429431
return pet;

CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public void testGetAuthentications() {
128128
}
129129
}
130130

131-
@Ignore("There is no more basic auth in petstore security definitions")
132131
@Test
133132
public void testSetUsernameAndPassword() {
134133
HttpBasicAuth auth = null;

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,11 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
745745
- 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)
746746
- 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/)
747747
- 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/)
748+
- 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)
748749
- 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le)
750+
- 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)
751+
- 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/)
752+
- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried)
749753

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

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

764769
:heart: = Link to support the contributor directly
765770

@@ -774,6 +779,7 @@ Here is a list of template creators:
774779
* Bash: @bkryza
775780
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
776781
* C++ REST: @Danielku15
782+
* C++ UE4: @Kahncode
777783
* C# (.NET 2.0): @who
778784
* C# (.NET Standard 1.3 ): @Gronsak
779785
* C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)
@@ -817,6 +823,7 @@ Here is a list of template creators:
817823
* Perl: @wing328 [:heart:](https://www.patreon.com/wing328)
818824
* PHP (Guzzle): @baartosz
819825
* PowerShell: @beatcracker
826+
* PowerShell (refactored in 5.0.0): @wing328
820827
* Python-experimental: @spacether
821828
* R: @ramnov
822829
* Ruby (Faraday): @meganemura @dkliban
@@ -885,6 +892,7 @@ Here is a list of template creators:
885892
* AsciiDoc: @man-at-home
886893
* HTML Doc 2: @jhitchcock
887894
* Confluence Wiki: @jhitchcock
895+
* PlantUML: @pburls
888896
* Configuration
889897
* Apache2: @stkrwork
890898
* k6: @mostafa
@@ -936,7 +944,7 @@ If you want to join the committee, please kindly apply by sending an email to te
936944
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
937945
| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) @shibayan (2020/02) |
938946
| Clojure | |
939-
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12) |
947+
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) |
940948
| Eiffel | @jvelilla (2017/09) |
941949
| Elixir | @mrmstn (2018/12) |
942950
| Elm | @eriktim (2018/09) |
@@ -955,8 +963,8 @@ If you want to join the committee, please kindly apply by sending an email to te
955963
| OCaml | @cgensoul (2019/08) |
956964
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
957965
| 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) |
958-
| PowerShell | |
959-
| 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) |
966+
| PowerShell | @wing328 (2020/05) |
967+
| 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) |
960968
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
961969
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
962970
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) @paladinzh (2020/05) |

bin/cpp-ue4-petstore.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
5+
while [ -h "$SCRIPT" ] ; do
6+
ls=`ls -ld "$SCRIPT"`
7+
link=`expr "$ls" : '.*-> \(.*\)$'`
8+
if expr "$link" : '/.*' > /dev/null; then
9+
SCRIPT="$link"
10+
else
11+
SCRIPT=`dirname "$SCRIPT"`/"$link"
12+
fi
13+
done
14+
15+
if [ ! -d "${APP_DIR}" ]; then
16+
APP_DIR=`dirname "$SCRIPT"`/..
17+
APP_DIR=`cd "${APP_DIR}"; pwd`
18+
fi
19+
20+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
21+
22+
if [ ! -f "$executable" ]
23+
then
24+
mvn clean package
25+
fi
26+
27+
# if you've executed sbt assembly previously it will use that instead.
28+
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29+
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"
30+
31+
java $JAVA_OPTS -jar $executable $ags

bin/erlang-petstore-client.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ 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/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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/erlang-petstore-proper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ 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/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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/erlang-petstore-server.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ 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/erlang-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/nodejs-express-petstore-server.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ 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/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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/ocaml-petstore.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fi
2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
3030

31-
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 $@"
31+
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 $@"
3232

3333
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
3434
java $JAVA_OPTS -jar $executable $args

bin/openapi3/erlang-petstore-client.sh

-32
This file was deleted.

bin/openapi3/erlang-petstore-server.sh

-32
This file was deleted.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
4+
./bin/openapi3/kotlin-client-petstore.sh
5+
./bin/openapi3/kotlin-client-petstore-multiplatform.sh
6+
./bin/openapi3/kotlin-client-petstore-nullable-required.sh
7+
./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh
8+
./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh
9+
./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh
10+

bin/openapi3/kotlin-client-petstore-multiplatform.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ then
2525
mvn clean package
2626
fi
2727

28+
samplePath="samples/openapi3/client/petstore/kotlin-multiplatform"
29+
2830
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
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 $@"
31+
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 $@"
3032

31-
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform"
32-
rm -rf samples/openapi3/client/petstore/kotlin-multiplatform
33+
echo "Cleaning previously generated files if any from $samplePath"
34+
rm -rf $samplePath
3335

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

bin/openapi3/kotlin-client-petstore-nullable-required.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ then
2525
mvn clean package
2626
fi
2727

28+
samplePath="samples/openapi3/client/petstore/kotlin-nullable-required"
29+
2830
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
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 $@"
31+
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 $@"
3032

31-
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-nullable-required"
32-
rm -rf samples/openapi3/client/petstore/kotlin-nullable-required
33+
echo "Cleaning previously generated files if any from $samplePath"
34+
rm -rf $samplePath
3335

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

0 commit comments

Comments
 (0)