Skip to content

Commit 96e803c

Browse files
committed
Merge branch 'master' into server-variable-substitution
* master: (122 commits) Fix #3604 by adding undefined as return type to headers and credentials methods in runtime.ts (#3605) Prepare 4.1.1-SNAPSHOT (#3603) Prepare 4.1.0 release (#3597) [java][client][jax-rs] Add a constant for Jackson @JsonProperty (#3560) restore openapi3 petstore.yaml (#3590) Add a new NodeJS Express server generator (#3567) [C#][client][csharp-netcore] Fix csharp netcore defaultheaders (#3562) Fix issue deserializing to nullptr (#3572) [OCaml] Add file post-processing (#3583) [dart2] Fix up test code generation, double deserialization, 'new' keyword deprecation (#3576) Run Qt5 client sample test (#3415) typescript-fetch: allow configuration of headers and credentials (#3586) using partials in ruby api_client (#3564) [OCaml] Added optional params support in API operations (#3568) [Rust Server] Generate valid Rustdocs for lazy_static items (#3556) Fix NPM build for Typescript-fetch (#3403) Expand path templates via resttemplate's uriTemplateHandler (#3500) Readme updated with a new tutorial and company using OpenAPI Generator (#3566) Fix logic of `getNullableType` of csharp server and client. (#3537) [Ruby] clean up Ruby dev dependencies (#3551) ...
2 parents 16d4501 + ac85c8f commit 96e803c

File tree

4,915 files changed

+151849
-22806
lines changed

Some content is hidden

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

4,915 files changed

+151849
-22806
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,7 @@ samples/client/petstore/elm/index.html
232232
# C
233233
samples/client/petstore/c/build
234234
samples/client/petstore/c/*.so
235+
236+
# Ruby
237+
samples/openapi3/client/petstore/ruby/Gemfile.lock
238+
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ before_install:
9494
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
9595
# - . ~/otp/18.2.1/activate && erl -version
9696
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
97+
# install Qt 5.10
98+
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
99+
- sudo apt-get update -qq
100+
- sudo apt-get install qt510-meta-minimal
101+
- source /opt/qt510/bin/qt510-env.sh
102+
- qmake -v
97103

98104
# show host table to confirm petstore.swagger.io is mapped to localhost
99105
- cat /etc/hosts

CI/.drone.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
kind: pipeline
2+
name: default
3+
4+
steps:
5+
# test Java 11 HTTP client
6+
- name: java11-test
7+
image: hirokimatsumoto/alpine-openjdk-11
8+
commands:
9+
- ./mvnw clean install
10+
- ./mvnw --quiet verify -Psamples.droneio
11+
# test ocaml petstore client
12+
- name: ocaml-test
13+
image: ocaml/opam2:4.07
14+
commands:
15+
- sudo apt-get -y install m4
16+
- cd samples/client/petstore/ocaml
17+
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
18+
- eval $(opam env)
19+
- sudo chmod -R 777 .
20+
- dune build --build-dir=./_build

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import org.junit.*;
1212
import static org.junit.Assert.*;
13+
import static org.hamcrest.CoreMatchers.*;
1314

1415

1516
public class ApiClientTest {
@@ -329,24 +330,18 @@ public void testSanitizeFilename() {
329330
assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif"));
330331
}
331332

332-
333333
@Test
334-
public void testInterceptorCleanupWithNewClient() {
334+
public void testNewHttpClient() {
335335
OkHttpClient oldClient = apiClient.getHttpClient();
336-
assertEquals(1, oldClient.networkInterceptors().size());
337-
338-
OkHttpClient newClient = new OkHttpClient();
339-
apiClient.setHttpClient(newClient);
340-
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
341-
apiClient.setHttpClient(newClient);
342-
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
336+
apiClient.setHttpClient(oldClient.newBuilder().build());
337+
assertThat(apiClient.getHttpClient(), is(not(oldClient)));
343338
}
344339

345-
@Test
346-
public void testInterceptorCleanupWithSameClient() {
347-
OkHttpClient oldClient = apiClient.getHttpClient();
348-
assertEquals(1, oldClient.networkInterceptors().size());
349-
apiClient.setHttpClient(oldClient);
350-
assertEquals(1, apiClient.getHttpClient().networkInterceptors().size());
340+
/**
341+
* Tests the invariant that the HttpClient for the ApiClient must never be null
342+
*/
343+
@Test(expected = NullPointerException.class)
344+
public void testNullHttpClient() {
345+
apiClient.setHttpClient(null);
351346
}
352347
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.openapitools</groupId>
4+
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId>
5+
<packaging>pom</packaging>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>TS Fetch Multiple Parameters Petstore Client</name>
8+
<build>
9+
<plugins>
10+
<plugin>
11+
<artifactId>maven-dependency-plugin</artifactId>
12+
<executions>
13+
<execution>
14+
<phase>package</phase>
15+
<goals>
16+
<goal>copy-dependencies</goal>
17+
</goals>
18+
<configuration>
19+
<outputDirectory>${project.build.directory}</outputDirectory>
20+
</configuration>
21+
</execution>
22+
</executions>
23+
</plugin>
24+
</plugins>
25+
</build>
26+
</project>

README.md

Lines changed: 47 additions & 18 deletions
Large diffs are not rendered by default.

bin/go-experimental-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ rm -rf $STUB_DIR
3434

3535
# if you've executed sbt assembly previously it will use that instead.
3636
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
37-
ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR -DpackageName=petstore $@"
37+
ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore $@"
3838

3939
java $JAVA_OPTS -jar $executable $ags

bin/java-petstore-all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
./bin/java-petstore-feign-10x.sh
88
./bin/java-petstore-okhttp-gson.sh
99
./bin/java-petstore-okhttp-gson-parcelable.sh
10+
./bin/java-petstore-native.sh
1011
./bin/java-petstore-retrofit.sh
1112
./bin/java-petstore-retrofit2.sh
1213
./bin/java-petstore-retrofit2rx.sh

bin/java-petstore-jersey1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ 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 --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 --additional-properties useNullForUnknownEnumValue=true $@"
30+
ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 $@"
3131

3232
echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
3333
rm -rf samples/client/petstore/java/jersey1/src/main

bin/java-petstore-jersey2.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"library": "jersey2",
3-
"artifactId": "petstore-jersey2",
4-
"additionalProperties" : {
5-
"useNullForUnknownEnumValue" : true
6-
}
3+
"artifactId": "petstore-jersey2"
74
}

bin/java-petstore-native.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"library": "native",
3+
"artifactId": "petstore-native"
4+
}

bin/java-petstore-native.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
22+
23+
if [ ! -f "$executable" ]
24+
then
25+
mvn -B clean package
26+
fi
27+
28+
# if you've executed sbt assembly previously it will use that instead.
29+
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30+
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/native -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native --additional-properties hideGenerationTimestamp=true $@"
31+
32+
echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main"
33+
rm -rf samples/client/petstore/java/native/src/main
34+
find samples/client/petstore/java/native -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
35+
java $JAVA_OPTS -jar $executable $ags

bin/nodejs-express-petstore-server.sh

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

bin/ocaml-petstore.sh

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

bin/openapi3/ocaml-client-petstore.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
22+
23+
if [ ! -f "$executable" ]
24+
then
25+
mvn -B clean package
26+
fi
27+
28+
# if you've executed sbt assembly previously it will use that instead.
29+
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties"
30+
31+
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml -o samples/openapi3/client/petstore/ocaml/ --additional-properties packageName=petstore_client $@"
32+
33+
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
34+
java $JAVA_OPTS -jar $executable $args

bin/openapi3/php-symfony-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [ ! -d "${APP_DIR}" ]; then
2323
fi
2424

2525
# Make sure that we are regenerating the sample by removing any existing target directory
26-
TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-symfony/SymfonyBundle-php"
26+
TARGET_DIR="$SCRIPT_DIR/../../samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php"
2727
if [ -d "$TARGET_DIR" ]; then
2828
rm -rf $TARGET_DIR
2929
fi
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
22+
23+
if [ ! -f "$executable" ]
24+
then
25+
mvn clean package
26+
fi
27+
28+
# purge lib/doc folder
29+
echo "purge ruby petstore lib, docs folder"
30+
rm -Rf samples/openapi3/client/petstore/ruby-faraday/lib
31+
rm -Rf samples/openapi3/client/petstore/ruby-faraday/docs
32+
33+
# purge test files other than integration test
34+
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
35+
echo "purge ruby petstore spec"
36+
find samples/openapi3/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
37+
find samples/openapi3/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
38+
39+
# if you've executed sbt assembly previously it will use that instead.
40+
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
41+
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/openapi3/ruby-petstore-faraday.json -o samples/openapi3/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@"
42+
43+
java $JAVA_OPTS -jar $executable $ags
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"gemName": "petstore",
3+
"moduleName": "Petstore",
4+
"library": "faraday",
5+
"gemVersion": "1.0.0"
6+
}

bin/ruby-client-petstore-faraday.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
22+
23+
if [ ! -f "$executable" ]
24+
then
25+
mvn -B clean package
26+
fi
27+
28+
# if you've executed sbt assembly previously it will use that instead.
29+
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30+
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday $@"
31+
32+
java $JAVA_OPTS -jar $executable $ags

bin/ruby-petstore-faraday.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"gemName": "petstore",
3+
"moduleName": "Petstore",
4+
"library": "faraday",
5+
"gemVersion": "1.0.0"
6+
}

bin/ruby-petstore.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"gemName": "petstore",
3+
"library": "typhoeus",
34
"moduleName": "Petstore",
45
"gemVersion": "1.0.0"
56
}

0 commit comments

Comments
 (0)