Skip to content

Commit db5a1b5

Browse files
Update openapi generator version to v7.11.0 (was v7.10.0) (#160)
* Update openapi generator version to v7.11.0 (was v7.10.0) * A few improvements in configuration
1 parent 17f12c7 commit db5a1b5

21 files changed

+36
-36
lines changed

Diff for: .github/workflows/update-specs-and-client-libraries.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
python_version: ${{ steps.generator.outputs.python_urllib3_version }}
7777
ruby_version: ${{ steps.generator.outputs.ruby_faraday_version }}
7878
container:
79-
image: openapitools/openapi-generator-cli:v7.10.0
79+
image: openapitools/openapi-generator-cli:v7.11.0
8080
env:
8181
OPENAPI_GENERATOR_COMMAND: docker-entrypoint.sh
8282
BUMP_CLIENT_LIBRARY_VERSION: ${{ inputs.type-of-change }}

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ We recommend providing the generator with the options below (whenever available)
3636

3737
```yaml
3838
enumUnknownDefaultCase: true
39+
removeEnumValuePrefix: true
3940
useOneOfDiscriminatorLookup: true
4041
legacyDiscriminatorBehavior: false
4142
disallowAdditionalPropertiesIfNotPresent: false

Diff for: generators/common/config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ library: "${GENERATOR_LIBRARY}"
55
templateDir: generators/${GENERATOR}/templates
66
outputDir: generated/artifacts/${GENERATOR}
77
disallowAdditionalPropertiesIfNotPresent: false
8+
enumUnknownDefaultCase: true
9+
removeEnumValuePrefix: true
10+
licenseName: MIT
811
additionalProperties:
912
apiVersion: v3.6
1013
documentationUrl: https://documentation.onfido.com

Diff for: generators/java/okhttp-gson/config.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ developerName: Onfido
1414
developerOrganization: Onfido
1515
developerOrganizationUrl: http://onfido.com
1616
hideGenerationTimestamp: true
17-
enumUnknownDefaultCase: true
18-
licenseName: MIT
1917
licenseUrl: https://opensource.org/license/mit
2018
scmConnection: scm:git:git://github.com/onfido/onfido-java.git
2119
scmDeveloperConnection: scm:git:git://github.com/onfido/onfido-java.git

Diff for: generators/java/okhttp-gson/templates/SHA256SUM

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
16502193337397367078434a27f67edfc6410f4c06d12db876155885d6a49394 ./README.mustache
3-
a82c17a026cf8055c3bcfe41b940b165b5fc7126c58283c4c557d8b9ec668950 ./libraries/okhttp-gson/ApiClient.mustache
3+
31d82e31183e9a500a8ae415a288f6de4b7215f1ebe65c2afb791cd0d3b335d6 ./libraries/okhttp-gson/ApiClient.mustache
44
a1de601140f7e476752a87ae96902d45b499c8f8383eced56c6322e61549bdac ./libraries/okhttp-gson/api.mustache
55
245137cb0e10389bbe3b2c3061f3c3baa95ae35575b5b2576e0042a3942b742a ./libraries/okhttp-gson/oneof_model.mustache
66
2c2d109d7248ff40bc3309afd1b0aed95c0c0fac12814fe3354075b6f2649322 ./libraries/okhttp-gson/pojo.mustache

Diff for: generators/java/okhttp-gson/templates/libraries/okhttp-gson/ApiClient.mustache

+2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ import java.security.cert.CertificateException;
4747
import java.security.cert.CertificateFactory;
4848
import java.security.cert.X509Certificate;
4949
import java.text.DateFormat;
50+
{{#jsr310}}
5051
import java.time.LocalDate;
5152
import java.time.OffsetDateTime;
5253
import java.time.format.DateTimeFormatter;
54+
{{/jsr310}}
5355
import java.util.*;
5456
import java.util.Map.Entry;
5557
import java.util.concurrent.TimeUnit;

Diff for: generators/php/config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
gitRepoId: onfido-php
22
artifactVersion: ${CLIENT_LIBRARY_VERSION}
3-
enumUnknownDefaultCase: true
43
legacyDiscriminatorBehavior: false
54
composerPackageName: onfido/api
65
invokerPackage: Onfido

Diff for: generators/php/templates/Configuration.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ class Configuration
480480
* @param array|null $variables hash of variable and the corresponding value (optional)
481481
* @return string URL based on host settings
482482
*/
483-
public static function getHostString(array $hostSettings, $hostIndex, array $variables = null)
483+
public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null)
484484
{
485485
if (null === $variables) {
486486
$variables = [];

Diff for: generators/php/templates/ObjectSerializer.mustache

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class ObjectSerializer
4949
* Serialize data
5050
*
5151
* @param mixed $data the data to serialize
52-
* @param string $type the OpenAPIToolsType of the data
53-
* @param string $format the format of the OpenAPITools type of the data
52+
* @param string|null $type the OpenAPIToolsType of the data
53+
* @param string|null $format the format of the OpenAPITools type of the data
5454
*
5555
* @return scalar|object|array|null serialized form of $data
5656
*/
@@ -395,7 +395,7 @@ class ObjectSerializer
395395
*
396396
* @param mixed $data object or primitive to be deserialized
397397
* @param string $class class name is passed as a string
398-
* @param string[] $httpHeaders HTTP headers
398+
* @param string[]|null $httpHeaders HTTP headers
399399
*
400400
* @return object|array|null a single or an array of $class instances
401401
*/

Diff for: generators/php/templates/SHA256SUM

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
bb92a3f3107664c296ebc45c75bff7c88abf8b765565f4656a05e24234cb6d67 ./Configuration.mustache
3-
76386901de81eba7d06fa8be77fc23e319bf7deb904cce3eea7edab7bdfb55ad ./ObjectSerializer.mustache
2+
49dde1f93f8776b42eb1403b543701d0b281cf3af7e87410347d75134c2d95a2 ./Configuration.mustache
3+
527a44c59ebe56e5c04f2f9f62154dece24dd837bce65c6397022b2f2b23733e ./ObjectSerializer.mustache
44
8eebaed003795c011df87fecd1f89c630dd3f23282d80e7f407f62009e2cd0ee ./README.mustache
5-
2d94750ad5d913f8b7fbba24681c7cc1d75e96c89ec46c379e6625c825b39020 ./model_generic.mustache
5+
edaabf17b3ea7e18b4dff84940362c9571130aa64c5e79aa1af1063158b1b368 ./model_generic.mustache
66
37d3333c7c3dbc6f6bffe64ce076bc512a2a1e61e986738c8e023bb745168e9a ./phpunit.xml.mustache

Diff for: generators/php/templates/model_generic.mustache

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
2424
* @var string[]
2525
*/
2626
protected static $openAPITypes = [
27-
{{#allVars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
28-
{{/-last}}{{/allVars}}
27+
{{#vars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
28+
{{/-last}}{{/vars}}
2929
];
3030

3131
/**
@@ -240,10 +240,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
240240
/**
241241
* Constructor
242242
*
243-
* @param mixed[] $data Associated array of property values
243+
* @param mixed[]|null $data Associated array of property values
244244
* initializing the model
245245
*/
246-
public function __construct(array $data = null)
246+
public function __construct(?array $data = null)
247247
{
248248
{{#parentSchema}}
249249
parent::__construct($data);
@@ -566,5 +566,4 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
566566
{
567567
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
568568
}
569-
570569
}

Diff for: generators/python/urllib3/templates/SHA256SUM

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
47fdf5141b3d999914c33faff1626c6ac2f00f87fcf9653814084f1dc67351d9 ./README.mustache
33
6a196e67020d765512f0c8c88afc39ef9d3cacdd50a9eba6731a6dbb1997c6e5 ./__init__package.mustache
4-
50f1ab5d4640232a6efe52888a7664d60619d7edffc04bdf16fe6fd8c0070a95 ./api_client.mustache
4+
1038b2cefa0ba55211bc9a53886d821a5dc97e84317122617ed8a0abe2c85c0c ./api_client.mustache
55
28300d01dcb6061c45c6d68cba198d9ea3243a2650e5859c1f95a3d88520ac3b ./configuration.mustache
6-
f1311d8eea7bc28f5146b9a3cec52d8220e016cb6545c75242e8a11e6c6693d6 ./pyproject.mustache
6+
8d8d062eb225ee17721483a1c8dca7ce31bceb52e9b1e32823f87a9610b8dc95 ./pyproject.mustache
77
47d0cfca6043fc2c8bd2b5a09704e22b6a412c9ed425c3a83b6ab719cc129986 ./rest.mustache
8-
bdd482446d4f3601bebe6fb59dba40748d9e59dc709e9033a354802ff8187eeb ./setup.mustache
8+
c7a48ed926b4b140adcc466a1ea29b8f7780b6019867639312debaac4a940776 ./setup.mustache

Diff for: generators/python/urllib3/templates/api_client.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class ApiClient:
525525
if k in collection_formats:
526526
collection_format = collection_formats[k]
527527
if collection_format == 'multi':
528-
new_params.extend((k, str(value)) for value in v)
528+
new_params.extend((k, quote(str(value))) for value in v)
529529
else:
530530
if collection_format == 'ssv':
531531
delimiter = ' '

Diff for: generators/python/urllib3/templates/pyproject.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ package-mode = false {{! added opti
1717
[tool.poetry.dependencies]
1818
python = "^3.8"
1919

20-
urllib3 = ">= 1.25.3 < 3.0.0"
20+
urllib3 = ">= 1.25.3, < 3.0.0"
2121
python-dateutil = ">= 2.8.2"
2222
{{#asyncio}}
2323
aiohttp = ">= 3.8.4"
2424
aiohttp-retry = ">= 2.8.3"
2525
{{/asyncio}}
2626
{{#tornado}}
27-
tornado = ">=4.2 <5"
27+
tornado = ">=4.2, <5"
2828
{{/tornado}}
2929
{{#hasHttpSignatureMethods}}
3030
pem = ">= 19.3.0"

Diff for: generators/python/urllib3/templates/setup.mustache

-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ from setuptools import setup, find_packages # noqa: H301
1313
NAME = "{{{projectName}}}-python" {{! package name updated with -python suffix }}
1414
VERSION = "{{packageVersion}}"
1515
PYTHON_REQUIRES = ">= 3.8"
16-
{{#apiInfo}}
17-
{{#apis}}
18-
{{#-last}}
1916
REQUIRES = [
2017
"urllib3 >= 1.25.3, < 3.0.0",
2118
"python-dateutil >= 2.8.2",
@@ -52,6 +49,3 @@ setup(
5249
""", # noqa: E501
5350
package_data={"{{{packageName}}}": ["py.typed"]},
5451
)
55-
{{/-last}}
56-
{{/apis}}
57-
{{/apiInfo}}

Diff for: generators/ruby/faraday/config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
gitRepoId: onfido-ruby
22
gemVersion: ${CLIENT_LIBRARY_VERSION}
3-
enumUnknownDefaultCase: true
43
gemName: onfido
54
gemHomepage: https://github.com/onfido/onfido-ruby
65
gemLicense: MIT

Diff for: generators/ruby/faraday/exclusions.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/spec/
22
/git_push.sh
33
/docs/
4-
/.travis.yml
4+
/.travis.yml
5+
6+
# For local development
7+
/vendor/bundle

Diff for: generators/typescript-axios/config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
gitRepoId: onfido-node
22
npmName: "@onfido/api"
33
npmVersion: ${CLIENT_LIBRARY_VERSION}
4-
enumUnknownDefaultCase: true
54
supportsES6: true
65
withNodeImports: true
76
axiosVersion: ^1.7.4

Diff for: generators/typescript-axios/templates/SHA256SUM

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
e13ee7c0cad9a79bab00e8b2a7942bc5a78f63115ece3dfd71a6472bdb02dd22 ./README.mustache
33
3a077701e62c4d0942657c78cf0116cbe58436e34d723d81aaed7ed0d56d2ed1 ./api.mustache
44
244ce751d42c4d1ab2eadb28dbe6744e4e5a7c934ffde2eae9bf25b77ef12d49 ./apiInner.mustache
5-
d8d68213e1a9a9983f89f688aaf31360f69d34a871cab4fc94f59a40279b13d9 ./configuration.mustache
5+
fd915ea5c76b1a1c7911d02f4d2260815ec3c8f61073ee5ac443f1d534c28d29 ./configuration.mustache
66
5030fcd1954b4d981f2d06fce4900fe29c97c7b74ee66f2eb5f45e81b9252a94 ./index.mustache
77
ddc15a816c127736387e9ad99dfa9e965c587ff80b599b286e0d614e69c602e0 ./package.mustache
88
89b381b068d1849cc98721643c923ee153a5bdd69e19306dda59114ba0a2e243 ./tsconfig.mustache

Diff for: generators/typescript-axios/templates/configuration.mustache

+5-2
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ export class Configuration {
9191

9292
this.apiKey = 'Token token=' + param.apiToken;
9393
this.basePath = param.basePath || BASE_PATH.replace('.eu.', `.${Region[param.region || Region.EU].toLowerCase()}.`);
94+
{{! set a default timeout value, add baseOptions before headers, injiect form-data and fix user-agent }}
9495
this.baseOptions = {...{ timeout: 30_000 },
9596
...param.baseOptions,
96-
...{ headers: {...param.baseOptions?.headers,
97-
...{'User-Agent': '{{httpUserAgent}}'}}}};
97+
headers: {...param.baseOptions?.headers,
98+
'User-Agent': "{{httpUserAgent}}"
99+
},
100+
};
98101
this.formDataCtor = param.formDataCtor || require('form-data'); // Injiect form data constructor (if needed)
99102
}
100103

Diff for: shell/generate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COMMON_CONFIG_FILE="generators/common/config.yaml"
1010
GENERATORS=${*:-`find generators -name 'config.yaml' -exec dirname {} \; | sed 's/generators\///'`}
1111
GENERATED_CONFIG_FILES=""
1212
13-
OPENAPI_GENERATOR_VERSION=${OPENAPI_GENERATOR_VERSION:-v7.10.0}
13+
OPENAPI_GENERATOR_VERSION=${OPENAPI_GENERATOR_VERSION:-v7.11.0}
1414
OPENAPI_GENERATOR_COMMAND=${OPENAPI_GENERATOR_COMMAND:-\
1515
docker run --rm -v "$(pwd):/local" -w /local \
1616
openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_VERSION}}

0 commit comments

Comments
 (0)