Skip to content

Commit 381fe91

Browse files
committed
Merge branch 'master' into feature-sets-meta
* master: (142 commits) smaller tests, better code format (#4355) csharp-netcore: Replace null literals with default (#4345) [core] consider polymorphism when computing unused schemas (#4335) Fix issue 4326 forward throws for delegate to main method (#4327) [kotlin][client] annotate api exceptions (#4339) refactor java-vertx-web parameters and bugfix on non primitive parameter (#4353) Remove deprecated API use of ObjectFactory.property() (#2613) (#4352) [python][metadata]: Adding license and author fields (#4318) [Python] Avoid pep8 violation (#4316) [JS] Update package.json (#4261) Add slash-arun to Python technical committee (#4354) [typescript-fetch] Fix discriminator mapping name (#4340) fix security alerts reported by github (#4344) fix cpp-restbed-server json field serialization #4320 (#4323) typescript-angular: fix oneOf and anyOf generates incorrect model for primitive types (#4341) fix(typescript-angular): do not call .toISOString() on a string (#4330) (#4337) update samples (#4334) Prepare 4.2.0 release (#4333) [FEATURE][Haskell] Haskell-Servant serves static files (#4058) [FEATURE][Haskell] Add Middleware support for the haskell servant generator (#4056) ...
2 parents f8c2011 + 2a2c5c5 commit 381fe91

File tree

4,581 files changed

+59391
-85672
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,581 files changed

+59391
-85672
lines changed

.github/.test/samples.json

+81-11
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
]
135135
},
136136
{
137-
"input": "csharp-refactor-petstore.sh",
137+
"input": "csharp-netcore-petstore.sh",
138138
"matches": [
139139
"Client: C-Sharp"
140140
]
@@ -151,6 +151,12 @@
151151
"Client: Dart"
152152
]
153153
},
154+
{
155+
"input": "dart-dio-petstore.sh",
156+
"matches": [
157+
"Client: Dart"
158+
]
159+
},
154160
{
155161
"input": "dart-petstore.sh",
156162
"matches": [
@@ -212,7 +218,7 @@
212218
]
213219
},
214220
{
215-
"input": "finch-petstore-server.sh",
221+
"input": "scala-finch-petstore-server.sh",
216222
"matches": [
217223
"Server: Scala"
218224
]
@@ -254,7 +260,7 @@
254260
]
255261
},
256262
{
257-
"input": "graphql-server-petstore.sh",
263+
"input": "graphql-nodejs-express-server.sh",
258264
"matches": [
259265
"Server: GraphQL"
260266
]
@@ -819,13 +825,13 @@
819825
]
820826
},
821827
{
822-
"input": "python-flask-petstore-python2.sh",
828+
"input": "python-server-flask-petstore-python2.sh",
823829
"matches": [
824830
"Server: Python"
825831
]
826832
},
827833
{
828-
"input": "python-flask-petstore.sh",
834+
"input": "python-server-flask-petstore.sh",
829835
"matches": [
830836
"Server: Python"
831837
]
@@ -872,12 +878,6 @@
872878
"Client: Rust"
873879
]
874880
},
875-
{
876-
"input": "rust-reqwest-petstore.sh",
877-
"matches": [
878-
"Client: Rust"
879-
]
880-
},
881881
{
882882
"input": "rust-server-petstore.sh",
883883
"matches": [
@@ -1305,6 +1305,76 @@
13051305
"matches": [
13061306
"Announcement"
13071307
]
1308+
},
1309+
{
1310+
"input": "[typescript] Generic typescript text",
1311+
"matches": [
1312+
"Client: TypeScript"
1313+
]
1314+
},
1315+
{
1316+
"input": "[typescript] Generic typescript text",
1317+
"matches": [
1318+
"Client: TypeScript"
1319+
]
1320+
},
1321+
{
1322+
"input": "[typescript-angular] Generic typescript text",
1323+
"matches": [
1324+
"Client: TypeScript"
1325+
]
1326+
},
1327+
{
1328+
"input": "[typescript-angularjs] Generic typescript text",
1329+
"matches": [
1330+
"Client: TypeScript"
1331+
]
1332+
},
1333+
{
1334+
"input": "[typescript-aurelia] Generic typescript text",
1335+
"matches": [
1336+
"Client: TypeScript"
1337+
]
1338+
},
1339+
{
1340+
"input": "[typescript-axios] Generic typescript text",
1341+
"matches": [
1342+
"Client: TypeScript"
1343+
]
1344+
},
1345+
{
1346+
"input": "[typescript-fetch] Generic typescript text",
1347+
"matches": [
1348+
"Client: TypeScript"
1349+
]
1350+
},
1351+
{
1352+
"input": "[typescript-inversify] Generic typescript text",
1353+
"matches": [
1354+
"Client: TypeScript"
1355+
]
1356+
},
1357+
{
1358+
"input": "[typescript-jquery] Generic typescript text",
1359+
"matches": [
1360+
"Client: TypeScript"
1361+
]
1362+
},
1363+
{
1364+
"input": "[typescript-node] Generic typescript text",
1365+
"matches": [
1366+
"Client: TypeScript"
1367+
]
1368+
},
1369+
{
1370+
"input": "[typescript-rxjs] Generic typescript text",
1371+
"matches": [
1372+
"Client: TypeScript"
1373+
]
1374+
},
1375+
{
1376+
"input": "Should not auto-label for typescript outside of brackets.",
1377+
"matches": []
13081378
}
13091379
]
13101380
}

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
### PR checklist
55

66
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
7-
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) before .
7+
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) before.
88
- [ ] Run the shell script(s) under `./bin/` (or Windows batch scripts under`.\bin\windows`) to update Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the code or mustache templates for a language (`{LANG}`) (e.g. php, ruby, python, etc).
99
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.1.x`, `5.0.x`. Default: `master`.
1010
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.

.github/auto-labeler.yml

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ labels:
138138
- '\s*?-[gl] swift[34]+\s*?'
139139
- '\s*?-[gl] swift2-deprecated\s*?'
140140
'Client: TypeScript':
141+
- '\s*?\[typescript\]\s*?'
141142
- '\s*?\[typescript-[\-a-z]+\]\s*?'
142143
- '\s*?-[gl] typescript-[\-a-z]+\s*?'
143144
# 'Client: VB/VB.net': # NOTE: Not yet implemented

.travis.yml

+9-14
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ before_install:
7171
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
7272
- docker ps -a
7373
# Add bats test framework and cURL for Bash script integration tests
74-
#- sudo add-apt-repository ppa:duggan/bats --yes
75-
#- sudo apt-get update -qq
76-
#- sudo apt-get install -qq bats
77-
#- sudo apt-get install -qq curl
74+
- sudo add-apt-repository ppa:duggan/bats --yes
75+
- sudo apt-get update -qq
76+
- sudo apt-get install -qq bats
77+
- sudo apt-get install -qq curl
7878
# install dart
7979
#- sudo apt-get update
8080
#- sudo apt-get install apt-transport-https
@@ -94,16 +94,11 @@ 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-
# comment out the following due to failure in downloading http://ppa.launchpad.net/beineri/opt-qt-5.10.1-trusty/ubuntu/dists/xenial/main/binary-amd64/Packages
101-
#- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
102-
#- sudo apt-get update -qq
103-
#- sudo apt-get install qt510-meta-minimal
104-
#- source /opt/qt510/bin/qt510-env.sh
105-
#- qmake -v
106-
97+
# install C++ tools
98+
- sudo apt install -y --no-install-recommends valgrind cmake build-essential
99+
# install Qt5
100+
- sudo apt install -y --no-install-recommends qt5-default
101+
- cmake --version
107102
# show host table to confirm petstore.swagger.io is mapped to localhost
108103
- cat /etc/hosts
109104
# show java version

CI/circle_parallel.sh

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ elif [ "$NODE_INDEX" = "2" ]; then
2424
# install elm-format
2525
npm install -g elm-format
2626

27+
# clear any changes to the samples
28+
git checkout -- .
29+
30+
# look for outdated samples
2731
./bin/utils/ensure-up-to-date
2832
fi
2933
#elif [ "$NODE_INDEX" = "3" ]; then

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

+28-4
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,57 @@ public class ApiKeyAuthTest {
1515
public void testApplyToParamsInQuery() {
1616
List<Pair> queryParams = new ArrayList<Pair>();
1717
Map<String, String> headerParams = new HashMap<String, String>();
18+
Map<String, String> cookieParams = new HashMap<String, String>();
1819

1920
ApiKeyAuth auth = new ApiKeyAuth("query", "api_key");
2021
auth.setApiKey("my-api-key");
21-
auth.applyToParams(queryParams, headerParams);
22+
auth.applyToParams(queryParams, headerParams, cookieParams);
2223

2324
assertEquals(1, queryParams.size());
2425
for (Pair queryParam : queryParams) {
2526
assertEquals("my-api-key", queryParam.getValue());
2627
}
2728

28-
// no changes to header parameters
29+
// no changes to header or cookie parameters
2930
assertEquals(0, headerParams.size());
31+
assertEquals(0, cookieParams.size());
3032
}
3133

3234
@Test
3335
public void testApplyToParamsInHeaderWithPrefix() {
3436
List<Pair> queryParams = new ArrayList<Pair>();
3537
Map<String, String> headerParams = new HashMap<String, String>();
38+
Map<String, String> cookieParams = new HashMap<String, String>();
3639

3740
ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN");
3841
auth.setApiKey("my-api-token");
3942
auth.setApiKeyPrefix("Token");
40-
auth.applyToParams(queryParams, headerParams);
43+
auth.applyToParams(queryParams, headerParams, cookieParams);
4144

42-
// no changes to query parameters
45+
// no changes to query or cookie parameters
4346
assertEquals(0, queryParams.size());
47+
assertEquals(0, cookieParams.size());
48+
4449
assertEquals(1, headerParams.size());
4550
assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN"));
4651
}
52+
53+
@Test
54+
public void testApplyToParamsInCookieWithPrefix() {
55+
List<Pair> queryParams = new ArrayList<Pair>();
56+
Map<String, String> headerParams = new HashMap<String, String>();
57+
Map<String, String> cookieParams = new HashMap<String, String>();
58+
59+
ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN");
60+
auth.setApiKey("my-api-token");
61+
auth.setApiKeyPrefix("Token");
62+
auth.applyToParams(queryParams, headerParams, cookieParams);
63+
64+
// no changes to query or header parameters
65+
assertEquals(0, queryParams.size());
66+
assertEquals(0, headerParams.size());
67+
68+
assertEquals(1, cookieParams.size());
69+
assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN"));
70+
}
4771
}

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,31 @@ public void setup() {
2222
public void testApplyToParams() {
2323
List<Pair> queryParams = new ArrayList<Pair>();
2424
Map<String, String> headerParams = new HashMap<String, String>();
25+
Map<String, String> cookieParams = new HashMap<String, String>();
2526

2627
auth.setUsername("my-username");
2728
auth.setPassword("my-password");
28-
auth.applyToParams(queryParams, headerParams);
29+
auth.applyToParams(queryParams, headerParams, cookieParams);
2930

30-
// no changes to query parameters
31+
// no changes to query or cookie parameters
3132
assertEquals(0, queryParams.size());
33+
assertEquals(0, cookieParams.size());
3234
assertEquals(1, headerParams.size());
3335
// the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix
3436
String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ=";
3537
assertEquals(expected, headerParams.get("Authorization"));
3638

3739
// null username should be treated as empty string
3840
auth.setUsername(null);
39-
auth.applyToParams(queryParams, headerParams);
41+
auth.applyToParams(queryParams, headerParams, cookieParams);
4042
// the string below is base64-encoded result of ":my-password" with the "Basic " prefix
4143
expected = "Basic Om15LXBhc3N3b3Jk";
4244
assertEquals(expected, headerParams.get("Authorization"));
4345

4446
// null password should be treated as empty string
4547
auth.setUsername("my-username");
4648
auth.setPassword(null);
47-
auth.applyToParams(queryParams, headerParams);
49+
auth.applyToParams(queryParams, headerParams, cookieParams);
4850
// the string below is base64-encoded result of "my-username:" with the "Basic " prefix
4951
expected = "Basic bXktdXNlcm5hbWU6";
5052
assertEquals(expected, headerParams.get("Authorization"));

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

+25-3
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,55 @@ public class ApiKeyAuthTest {
1515
public void testApplyToParamsInQuery() {
1616
List<Pair> queryParams = new ArrayList<Pair>();
1717
Map<String, String> headerParams = new HashMap<String, String>();
18+
Map<String, String> cookieParams = new HashMap<String, String>();
1819

1920
ApiKeyAuth auth = new ApiKeyAuth("query", "api_key");
2021
auth.setApiKey("my-api-key");
21-
auth.applyToParams(queryParams, headerParams);
22+
auth.applyToParams(queryParams, headerParams, cookieParams);
2223

2324
assertEquals(1, queryParams.size());
2425
for (Pair queryParam : queryParams) {
2526
assertEquals("my-api-key", queryParam.getValue());
2627
}
2728

28-
// no changes to header parameters
29+
// no changes to header or cookie parameters
2930
assertEquals(0, headerParams.size());
31+
assertEquals(0, cookieParams.size());
3032
}
3133

3234
@Test
3335
public void testApplyToParamsInHeaderWithPrefix() {
3436
List<Pair> queryParams = new ArrayList<Pair>();
3537
Map<String, String> headerParams = new HashMap<String, String>();
38+
Map<String, String> cookieParams = new HashMap<String, String>();
3639

3740
ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN");
3841
auth.setApiKey("my-api-token");
3942
auth.setApiKeyPrefix("Token");
40-
auth.applyToParams(queryParams, headerParams);
43+
auth.applyToParams(queryParams, headerParams, cookieParams);
4144

4245
// no changes to query parameters
4346
assertEquals(0, queryParams.size());
47+
assertEquals(0, cookieParams.size());
4448
assertEquals(1, headerParams.size());
4549
assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN"));
4650
}
51+
52+
@Test
53+
public void testApplyToParamsInCookieWithPrefix() {
54+
List<Pair> queryParams = new ArrayList<Pair>();
55+
Map<String, String> headerParams = new HashMap<String, String>();
56+
Map<String, String> cookieParams = new HashMap<String, String>();
57+
58+
ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN");
59+
auth.setApiKey("my-api-token");
60+
auth.setApiKeyPrefix("Token");
61+
auth.applyToParams(queryParams, headerParams, cookieParams);
62+
63+
// no changes to query or header parameters
64+
assertEquals(0, queryParams.size());
65+
assertEquals(0, headerParams.size());
66+
assertEquals(1, cookieParams.size());
67+
assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN"));
68+
}
4769
}

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ public void setup() {
2222
public void testApplyToParams() {
2323
List<Pair> queryParams = new ArrayList<Pair>();
2424
Map<String, String> headerParams = new HashMap<String, String>();
25+
Map<String, String> cookieParams = new HashMap<String, String>();
2526

2627
auth.setUsername("my-username");
2728
auth.setPassword("my-password");
28-
auth.applyToParams(queryParams, headerParams);
29+
auth.applyToParams(queryParams, headerParams, cookieParams);
2930

3031
// no changes to query parameters
3132
assertEquals(0, queryParams.size());
@@ -36,15 +37,15 @@ public void testApplyToParams() {
3637

3738
// null username should be treated as empty string
3839
auth.setUsername(null);
39-
auth.applyToParams(queryParams, headerParams);
40+
auth.applyToParams(queryParams, headerParams, cookieParams);
4041
// the string below is base64-encoded result of ":my-password" with the "Basic " prefix
4142
expected = "Basic Om15LXBhc3N3b3Jk";
4243
assertEquals(expected, headerParams.get("Authorization"));
4344

4445
// null password should be treated as empty string
4546
auth.setUsername("my-username");
4647
auth.setPassword(null);
47-
auth.applyToParams(queryParams, headerParams);
48+
auth.applyToParams(queryParams, headerParams, cookieParams);
4849
// the string below is base64-encoded result of "my-username:" with the "Basic " prefix
4950
expected = "Basic bXktdXNlcm5hbWU6";
5051
assertEquals(expected, headerParams.get("Authorization"));

0 commit comments

Comments
 (0)