Skip to content

Commit 636033a

Browse files
author
JBurgess
committed
Merge remote-tracking branch 'upstream/master' into issue3310
2 parents 0be6969 + 7dbda04 commit 636033a

File tree

7,301 files changed

+268386
-64642
lines changed

Some content is hidden

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

7,301 files changed

+268386
-64642
lines changed

.github/.test/samples.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,6 @@
145145
"Documentation: Cwiki"
146146
]
147147
},
148-
{
149-
"input": "dart-flutter-petstore.sh",
150-
"matches": [
151-
"Client: Dart"
152-
]
153-
},
154148
{
155149
"input": "dart-jaguar-petstore.sh",
156150
"matches": [

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ samples/client/petstore/python-tornado/.venv/
174174
samples/client/petstore/typescript-angular2/npm/npm-debug.log
175175
samples/client/petstore/typescript-node/npm/npm-debug.log
176176
samples/client/petstore/typescript-angular/tsd-debug.log
177+
samples/client/petstore/typescript-fetch/tests/**/dist/
177178

178179
# aspnetcore
179180
samples/server/petstore/aspnetcore/.vs/
@@ -186,6 +187,7 @@ samples/client/petstore/kotlin-string/build
186187
samples/openapi3/client/petstore/kotlin/build
187188
samples/server/petstore/kotlin-server/ktor/build
188189
samples/server/petstore/kotlin-springboot/build
190+
samples/client/petstore/kotlin-multiplatform/build/
189191
\?
190192

191193
# haskell
@@ -232,3 +234,7 @@ samples/client/petstore/elm/index.html
232234
# C
233235
samples/client/petstore/c/build
234236
samples/client/petstore/c/*.so
237+
238+
# Ruby
239+
samples/openapi3/client/petstore/ruby/Gemfile.lock
240+
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ 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 valgrind for C++ memory test
98+
- sudo apt-get install valgrind
99+
# install Qt 5.10
100+
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
101+
- sudo apt-get update -qq
102+
- sudo apt-get install qt510-meta-minimal
103+
- source /opt/qt510/bin/qt510-env.sh
104+
- qmake -v
97105

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

CI/.drone.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
kind: pipeline
2+
name: default
3+
4+
steps:
5+
# test haskell client
6+
- name: haskell-client-test
7+
image: haskell:8.6.5
8+
commands:
9+
- (cd samples/client/petstore/haskell-http-client/ && stack --install-ghc --no-haddock-deps haddock --fast && stack test --fast)
10+
# test Dart 2.x petstore client
11+
- name: dart2x-test
12+
image: google/dart
13+
commands:
14+
- (cd samples/client/petstore/dart-jaguar/openapi && pub get && pub run build_runner build --delete-conflicting-outputs)
15+
- (cd samples/client/petstore/dart-jaguar/flutter_petstore/openapi && pub get && pub run build_runner build --delete-conflicting-outputs)
16+
- (cd samples/client/petstore/dart2/openapi && pub get && pub run test)
17+
# test Java 11 HTTP client
18+
- name: java11-test
19+
image: openjdk:11.0
20+
commands:
21+
- ./mvnw clean install
22+
- ./mvnw --quiet verify -Psamples.droneio
23+
# test all generators with fake petstore spec (2.0, 3.0)
24+
- /bin/bash bin/utils/test-fake-petstore-for-all.sh
25+
# generate test scripts
26+
- /bin/bash bin/tests/run-all-test
27+
# generate all petstore samples (client, servers, doc)
28+
- /bin/bash bin/run-all-petstore
29+
# generate all petstore samples (openapi3)
30+
- /bin/bash bin/openapi3/run-all-petstore
31+
# test ocaml petstore client
32+
- name: ocaml-test
33+
image: ocaml/opam2:4.07
34+
commands:
35+
- sudo apt-get -y install m4
36+
- cd samples/client/petstore/ocaml
37+
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
38+
- eval $(opam env)
39+
- sudo chmod -R 777 .
40+
- dune build --build-dir=./_build

CI/circle_parallel.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,13 @@ if [ "$NODE_INDEX" = "1" ]; then
1414
mvn --quiet verify -Psamples.circleci
1515
mvn --quiet javadoc:javadoc -Psamples.circleci
1616

17-
# generate all petstore samples (client, servers, doc)
18-
./bin/run-all-petstore
19-
# generate all petstore samples (openapi3)
20-
./bin/openapi3/run-all-petstore
21-
# generate test scripts
22-
./bin/tests/run-all-test
23-
# test all generators with fake petstore spec (2.0, 3.0)
24-
./bin/utils/test-fake-petstore-for-all.sh
2517
elif [ "$NODE_INDEX" = "2" ]; then
2618
# run ensure-up-to-date sample script on SNAPSHOT version only
2719
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
2820
if [[ $project_version == *"-SNAPSHOT" ]]; then
2921
echo "Running node $NODE_INDEX to test ensure-up-to-date"
3022
java -version
3123

32-
# install elm-format for formatting elm code
33-
npm install -g elm-format
34-
35-
# symlink elm-format
36-
sudo ln -s /opt/circleci/.nvm/versions/node/v12.1.0/bin/elm-format /usr/local/bin/elm-format
37-
3824
./bin/utils/ensure-up-to-date
3925
fi
4026
#elif [ "$NODE_INDEX" = "3" ]; then

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
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public void arrayArrayNumberTest() {
5353
List<BigDecimal> arrayArrayNumber = new ArrayList<BigDecimal>();
5454
arrayArrayNumber.add(b1);
5555
arrayArrayNumber.add(b2);
56+
model.setArrayArrayNumber(new ArrayList<List<BigDecimal>>());
5657
model.getArrayArrayNumber().add(arrayArrayNumber);
5758

5859
// create another instance for comparison
@@ -62,6 +63,7 @@ public void arrayArrayNumberTest() {
6263
List<BigDecimal> arrayArrayNumber2 = new ArrayList<BigDecimal>();
6364
arrayArrayNumber2.add(b1);
6465
arrayArrayNumber2.add(b2);
66+
model2.setArrayArrayNumber(new ArrayList<List<BigDecimal>>());
6567
model2.getArrayArrayNumber().add(arrayArrayNumber2);
6668

6769
Assert.assertTrue(model2.equals(model));
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>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.openapitools</groupId>
4+
<artifactId>TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests</artifactId>
5+
<packaging>pom</packaging>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>TS Fetch Petstore Client (with namespacing for parameter interfaces)</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+
<plugin>
25+
<groupId>org.codehaus.mojo</groupId>
26+
<artifactId>exec-maven-plugin</artifactId>
27+
<version>1.2.1</version>
28+
<executions>
29+
<execution>
30+
<id>npm-install</id>
31+
<phase>integration-test</phase>
32+
<goals>
33+
<goal>exec</goal>
34+
</goals>
35+
<configuration>
36+
<executable>npm</executable>
37+
<arguments>
38+
<argument>install</argument>
39+
</arguments>
40+
</configuration>
41+
</execution>
42+
<execution>
43+
<id>npm-build</id>
44+
<phase>integration-test</phase>
45+
<goals>
46+
<goal>exec</goal>
47+
</goals>
48+
<configuration>
49+
<executable>npm</executable>
50+
<arguments>
51+
<argument>run</argument>
52+
<argument>build</argument>
53+
</arguments>
54+
</configuration>
55+
</execution>
56+
<execution>
57+
<id>npm-test</id>
58+
<phase>integration-test</phase>
59+
<goals>
60+
<goal>exec</goal>
61+
</goals>
62+
<configuration>
63+
<executable>npm</executable>
64+
<arguments>
65+
<argument>test</argument>
66+
</arguments>
67+
</configuration>
68+
</execution>
69+
</executions>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
</project>

0 commit comments

Comments
 (0)