Skip to content

Commit 85a817b

Browse files
robbearNRHelmi
andauthored
Upgrade OpenAPI to version 5.0.0 (#4543)
* Upgrade to openapi-generator-cli version 5.0.0 Co-authored-by: Helmi Nour <Helmiinour@gmail.com>
1 parent c4ea73c commit 85a817b

File tree

109 files changed

+302
-263
lines changed

Some content is hidden

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

109 files changed

+302
-263
lines changed

client/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directory
27+
node_modules
28+
29+
# Optional npm cache directory
30+
.npm
31+
32+
# Optional REPL history
33+
.node_repl_history

client/.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0-beta2
1+
5.0.0

client/docs/LoadData.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**fileSchema** | [**FileSchema**](FileSchema.md) | | [optional]
1010
**fileSyntax** | [**FileSyntax**](FileSyntax.md) | | [optional]
1111
**integration** | [**Integration**](Integration.md) | | [optional]
12-
**key** | [**AnyType**](.md) | |
12+
**key** | **Object** | |
1313
**path** | **String** | | [optional]
1414
**type** | **String** | | [default to &#39;LoadData&#39;]
1515

client/docs/PairAnyValueAnyValue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**first** | [**AnyType**](.md) | | [optional]
8-
**second** | [**AnyType**](.md) | | [optional]
7+
**first** | **Object** | | [optional]
8+
**second** | **Object** | | [optional]
99
**type** | **String** | | [default to &#39;Pair_AnyValue_AnyValue_&#39;]
1010

1111

client/docs/Range.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**area** | [**Area**](Area.md) | |
88
**endByte** | **Number** | | [default to 0]
9-
**input** | [**AnyType**](.md) | | [optional]
9+
**input** | **Object** | | [optional]
1010
**startByte** | **Number** | | [default to 0]
1111
**type** | **String** | | [default to &#39;Range&#39;]
1212

client/docs/Relation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**columns** | **[[AnyType]]** | | [optional]
7+
**columns** | **[[Object]]** | | [optional]
88
**relKey** | [**RelKey**](RelKey.md) | |
99
**type** | **String** | | [default to &#39;Relation&#39;]
1010

client/src/ApiClient.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class ApiClient {
147147
url = apiBasePath + path;
148148
}
149149

150-
url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
150+
url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => {
151151
var value;
152152
if (pathParams.hasOwnProperty(key)) {
153153
value = this.paramToString(pathParams[key]);
@@ -265,16 +265,18 @@ class ApiClient {
265265
}
266266
switch (collectionFormat) {
267267
case 'csv':
268-
return param.map(this.paramToString).join(',');
268+
return param.map(this.paramToString, this).join(',');
269269
case 'ssv':
270-
return param.map(this.paramToString).join(' ');
270+
return param.map(this.paramToString, this).join(' ');
271271
case 'tsv':
272-
return param.map(this.paramToString).join('\t');
272+
return param.map(this.paramToString, this).join('\t');
273273
case 'pipes':
274-
return param.map(this.paramToString).join('|');
274+
return param.map(this.paramToString, this).join('|');
275275
case 'multi':
276276
//return the array directly as SuperAgent will handle it as expected
277-
return param.map(this.paramToString);
277+
return param.map(this.paramToString, this);
278+
case 'passthrough':
279+
return param;
278280
default:
279281
throw new Error('Unknown collection format: ' + collectionFormat);
280282
}
@@ -297,7 +299,10 @@ class ApiClient {
297299
break;
298300
case 'bearer':
299301
if (auth.accessToken) {
300-
request.set({'Authorization': 'Bearer ' + auth.accessToken});
302+
var localVarBearerToken = typeof auth.accessToken === 'function'
303+
? auth.accessToken()
304+
: auth.accessToken
305+
request.set({'Authorization': 'Bearer ' + localVarBearerToken});
301306
}
302307

303308
break;
@@ -431,11 +436,16 @@ class ApiClient {
431436
var _formParams = this.normalizeParams(formParams);
432437
for (var key in _formParams) {
433438
if (_formParams.hasOwnProperty(key)) {
434-
if (this.isFileParam(_formParams[key])) {
439+
let _formParamsValue = _formParams[key];
440+
if (this.isFileParam(_formParamsValue)) {
435441
// file field
436-
request.attach(key, _formParams[key]);
442+
request.attach(key, _formParamsValue);
443+
} else if (Array.isArray(_formParamsValue) && _formParamsValue.length
444+
&& this.isFileParam(_formParamsValue[0])) {
445+
// multiple files
446+
_formParamsValue.forEach(file => request.attach(key, file));
437447
} else {
438-
request.field(key, _formParams[key]);
448+
request.field(key, _formParamsValue);
439449
}
440450
}
441451
}

client/src/model/LoadData.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
import ApiClient from '../ApiClient';
15-
import AnyType from './AnyType';
1615
import FileSchema from './FileSchema';
1716
import FileSyntax from './FileSyntax';
1817
import Integration from './Integration';
@@ -27,7 +26,7 @@ class LoadData {
2726
* Constructs a new <code>LoadData</code>.
2827
* @alias module:model/LoadData
2928
* @param contentType {String}
30-
* @param key {module:model/AnyType}
29+
* @param key {Object}
3130
* @param type {module:model/LoadData.TypeEnum}
3231
*/
3332
constructor(contentType, key, type) {
@@ -73,7 +72,7 @@ class LoadData {
7372
obj['integration'] = Integration.constructFromObject(data['integration']);
7473
}
7574
if (data.hasOwnProperty('key')) {
76-
obj['key'] = ApiClient.convertToType(data['key'], AnyType);
75+
obj['key'] = ApiClient.convertToType(data['key'], Object);
7776
}
7877
if (data.hasOwnProperty('path')) {
7978
obj['path'] = ApiClient.convertToType(data['path'], 'String');
@@ -115,7 +114,7 @@ LoadData.prototype['file_syntax'] = undefined;
115114
LoadData.prototype['integration'] = undefined;
116115

117116
/**
118-
* @member {module:model/AnyType} key
117+
* @member {Object} key
119118
*/
120119
LoadData.prototype['key'] = undefined;
121120

client/src/model/PairAnyValueAnyValue.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
import ApiClient from '../ApiClient';
15-
import AnyType from './AnyType';
1615

1716
/**
1817
* The PairAnyValueAnyValue model module.
@@ -51,10 +50,10 @@ class PairAnyValueAnyValue {
5150
obj = obj || new PairAnyValueAnyValue();
5251

5352
if (data.hasOwnProperty('first')) {
54-
obj['first'] = ApiClient.convertToType(data['first'], AnyType);
53+
obj['first'] = ApiClient.convertToType(data['first'], Object);
5554
}
5655
if (data.hasOwnProperty('second')) {
57-
obj['second'] = ApiClient.convertToType(data['second'], AnyType);
56+
obj['second'] = ApiClient.convertToType(data['second'], Object);
5857
}
5958
if (data.hasOwnProperty('type')) {
6059
obj['type'] = ApiClient.convertToType(data['type'], 'String');
@@ -67,12 +66,12 @@ class PairAnyValueAnyValue {
6766
}
6867

6968
/**
70-
* @member {module:model/AnyType} first
69+
* @member {Object} first
7170
*/
7271
PairAnyValueAnyValue.prototype['first'] = undefined;
7372

7473
/**
75-
* @member {module:model/AnyType} second
74+
* @member {Object} second
7675
*/
7776
PairAnyValueAnyValue.prototype['second'] = undefined;
7877

client/src/model/Range.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
import ApiClient from '../ApiClient';
15-
import AnyType from './AnyType';
1615
import Area from './Area';
1716

1817
/**
@@ -64,7 +63,7 @@ class Range {
6463
obj['end_byte'] = ApiClient.convertToType(data['end_byte'], 'Number');
6564
}
6665
if (data.hasOwnProperty('input')) {
67-
obj['input'] = ApiClient.convertToType(data['input'], AnyType);
66+
obj['input'] = ApiClient.convertToType(data['input'], Object);
6867
}
6968
if (data.hasOwnProperty('start_byte')) {
7069
obj['start_byte'] = ApiClient.convertToType(data['start_byte'], 'Number');
@@ -91,7 +90,7 @@ Range.prototype['area'] = undefined;
9190
Range.prototype['end_byte'] = 0;
9291

9392
/**
94-
* @member {module:model/AnyType} input
93+
* @member {Object} input
9594
*/
9695
Range.prototype['input'] = undefined;
9796

0 commit comments

Comments
 (0)