Skip to content

Commit

Permalink
Update openapi generator version to v7.11.0 (was v7.10.0) (#160)
Browse files Browse the repository at this point in the history
* Update openapi generator version to v7.11.0 (was v7.10.0)

* A few improvements in configuration
  • Loading branch information
dvacca-onfido authored Feb 19, 2025
1 parent 17f12c7 commit db5a1b5
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-specs-and-client-libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
python_version: ${{ steps.generator.outputs.python_urllib3_version }}
ruby_version: ${{ steps.generator.outputs.ruby_faraday_version }}
container:
image: openapitools/openapi-generator-cli:v7.10.0
image: openapitools/openapi-generator-cli:v7.11.0
env:
OPENAPI_GENERATOR_COMMAND: docker-entrypoint.sh
BUMP_CLIENT_LIBRARY_VERSION: ${{ inputs.type-of-change }}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ We recommend providing the generator with the options below (whenever available)

```yaml
enumUnknownDefaultCase: true
removeEnumValuePrefix: true
useOneOfDiscriminatorLookup: true
legacyDiscriminatorBehavior: false
disallowAdditionalPropertiesIfNotPresent: false
Expand Down
3 changes: 3 additions & 0 deletions generators/common/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ library: "${GENERATOR_LIBRARY}"
templateDir: generators/${GENERATOR}/templates
outputDir: generated/artifacts/${GENERATOR}
disallowAdditionalPropertiesIfNotPresent: false
enumUnknownDefaultCase: true
removeEnumValuePrefix: true
licenseName: MIT
additionalProperties:
apiVersion: v3.6
documentationUrl: https://documentation.onfido.com
Expand Down
2 changes: 0 additions & 2 deletions generators/java/okhttp-gson/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ developerName: Onfido
developerOrganization: Onfido
developerOrganizationUrl: http://onfido.com
hideGenerationTimestamp: true
enumUnknownDefaultCase: true
licenseName: MIT
licenseUrl: https://opensource.org/license/mit
scmConnection: scm:git:git://github.com/onfido/onfido-java.git
scmDeveloperConnection: scm:git:git://github.com/onfido/onfido-java.git
Expand Down
2 changes: 1 addition & 1 deletion generators/java/okhttp-gson/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

16502193337397367078434a27f67edfc6410f4c06d12db876155885d6a49394 ./README.mustache
a82c17a026cf8055c3bcfe41b940b165b5fc7126c58283c4c557d8b9ec668950 ./libraries/okhttp-gson/ApiClient.mustache
31d82e31183e9a500a8ae415a288f6de4b7215f1ebe65c2afb791cd0d3b335d6 ./libraries/okhttp-gson/ApiClient.mustache
a1de601140f7e476752a87ae96902d45b499c8f8383eced56c6322e61549bdac ./libraries/okhttp-gson/api.mustache
245137cb0e10389bbe3b2c3061f3c3baa95ae35575b5b2576e0042a3942b742a ./libraries/okhttp-gson/oneof_model.mustache
2c2d109d7248ff40bc3309afd1b0aed95c0c0fac12814fe3354075b6f2649322 ./libraries/okhttp-gson/pojo.mustache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
{{#jsr310}}
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
{{/jsr310}}
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
Expand Down
1 change: 0 additions & 1 deletion generators/php/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
gitRepoId: onfido-php
artifactVersion: ${CLIENT_LIBRARY_VERSION}
enumUnknownDefaultCase: true
legacyDiscriminatorBehavior: false
composerPackageName: onfido/api
invokerPackage: Onfido
Expand Down
2 changes: 1 addition & 1 deletion generators/php/templates/Configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class Configuration
* @param array|null $variables hash of variable and the corresponding value (optional)
* @return string URL based on host settings
*/
public static function getHostString(array $hostSettings, $hostIndex, array $variables = null)
public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null)
{
if (null === $variables) {
$variables = [];
Expand Down
6 changes: 3 additions & 3 deletions generators/php/templates/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class ObjectSerializer
* Serialize data
*
* @param mixed $data the data to serialize
* @param string $type the OpenAPIToolsType of the data
* @param string $format the format of the OpenAPITools type of the data
* @param string|null $type the OpenAPIToolsType of the data
* @param string|null $format the format of the OpenAPITools type of the data
*
* @return scalar|object|array|null serialized form of $data
*/
Expand Down Expand Up @@ -395,7 +395,7 @@ class ObjectSerializer
*
* @param mixed $data object or primitive to be deserialized
* @param string $class class name is passed as a string
* @param string[] $httpHeaders HTTP headers
* @param string[]|null $httpHeaders HTTP headers
*
* @return object|array|null a single or an array of $class instances
*/
Expand Down
6 changes: 3 additions & 3 deletions generators/php/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

bb92a3f3107664c296ebc45c75bff7c88abf8b765565f4656a05e24234cb6d67 ./Configuration.mustache
76386901de81eba7d06fa8be77fc23e319bf7deb904cce3eea7edab7bdfb55ad ./ObjectSerializer.mustache
49dde1f93f8776b42eb1403b543701d0b281cf3af7e87410347d75134c2d95a2 ./Configuration.mustache
527a44c59ebe56e5c04f2f9f62154dece24dd837bce65c6397022b2f2b23733e ./ObjectSerializer.mustache
8eebaed003795c011df87fecd1f89c630dd3f23282d80e7f407f62009e2cd0ee ./README.mustache
2d94750ad5d913f8b7fbba24681c7cc1d75e96c89ec46c379e6625c825b39020 ./model_generic.mustache
edaabf17b3ea7e18b4dff84940362c9571130aa64c5e79aa1af1063158b1b368 ./model_generic.mustache
37d3333c7c3dbc6f6bffe64ce076bc512a2a1e61e986738c8e023bb745168e9a ./phpunit.xml.mustache
9 changes: 4 additions & 5 deletions generators/php/templates/model_generic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
* @var string[]
*/
protected static $openAPITypes = [
{{#allVars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
{{/-last}}{{/allVars}}
{{#vars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
{{/-last}}{{/vars}}
];

/**
Expand Down Expand Up @@ -240,10 +240,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* @param mixed[]|null $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
public function __construct(?array $data = null)
{
{{#parentSchema}}
parent::__construct($data);
Expand Down Expand Up @@ -566,5 +566,4 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}

}
6 changes: 3 additions & 3 deletions generators/python/urllib3/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

47fdf5141b3d999914c33faff1626c6ac2f00f87fcf9653814084f1dc67351d9 ./README.mustache
6a196e67020d765512f0c8c88afc39ef9d3cacdd50a9eba6731a6dbb1997c6e5 ./__init__package.mustache
50f1ab5d4640232a6efe52888a7664d60619d7edffc04bdf16fe6fd8c0070a95 ./api_client.mustache
1038b2cefa0ba55211bc9a53886d821a5dc97e84317122617ed8a0abe2c85c0c ./api_client.mustache
28300d01dcb6061c45c6d68cba198d9ea3243a2650e5859c1f95a3d88520ac3b ./configuration.mustache
f1311d8eea7bc28f5146b9a3cec52d8220e016cb6545c75242e8a11e6c6693d6 ./pyproject.mustache
8d8d062eb225ee17721483a1c8dca7ce31bceb52e9b1e32823f87a9610b8dc95 ./pyproject.mustache
47d0cfca6043fc2c8bd2b5a09704e22b6a412c9ed425c3a83b6ab719cc129986 ./rest.mustache
bdd482446d4f3601bebe6fb59dba40748d9e59dc709e9033a354802ff8187eeb ./setup.mustache
c7a48ed926b4b140adcc466a1ea29b8f7780b6019867639312debaac4a940776 ./setup.mustache
2 changes: 1 addition & 1 deletion generators/python/urllib3/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class ApiClient:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, str(value)) for value in v)
new_params.extend((k, quote(str(value))) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
Expand Down
4 changes: 2 additions & 2 deletions generators/python/urllib3/templates/pyproject.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package-mode = false {{! added opti
[tool.poetry.dependencies]
python = "^3.8"

urllib3 = ">= 1.25.3 < 3.0.0"
urllib3 = ">= 1.25.3, < 3.0.0"
python-dateutil = ">= 2.8.2"
{{#asyncio}}
aiohttp = ">= 3.8.4"
aiohttp-retry = ">= 2.8.3"
{{/asyncio}}
{{#tornado}}
tornado = ">=4.2 <5"
tornado = ">=4.2, <5"
{{/tornado}}
{{#hasHttpSignatureMethods}}
pem = ">= 19.3.0"
Expand Down
6 changes: 0 additions & 6 deletions generators/python/urllib3/templates/setup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ from setuptools import setup, find_packages # noqa: H301
NAME = "{{{projectName}}}-python" {{! package name updated with -python suffix }}
VERSION = "{{packageVersion}}"
PYTHON_REQUIRES = ">= 3.8"
{{#apiInfo}}
{{#apis}}
{{#-last}}
REQUIRES = [
"urllib3 >= 1.25.3, < 3.0.0",
"python-dateutil >= 2.8.2",
Expand Down Expand Up @@ -52,6 +49,3 @@ setup(
""", # noqa: E501
package_data={"{{{packageName}}}": ["py.typed"]},
)
{{/-last}}
{{/apis}}
{{/apiInfo}}
1 change: 0 additions & 1 deletion generators/ruby/faraday/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
gitRepoId: onfido-ruby
gemVersion: ${CLIENT_LIBRARY_VERSION}
enumUnknownDefaultCase: true
gemName: onfido
gemHomepage: https://github.com/onfido/onfido-ruby
gemLicense: MIT
Expand Down
5 changes: 4 additions & 1 deletion generators/ruby/faraday/exclusions.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/spec/
/git_push.sh
/docs/
/.travis.yml
/.travis.yml

# For local development
/vendor/bundle
1 change: 0 additions & 1 deletion generators/typescript-axios/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
gitRepoId: onfido-node
npmName: "@onfido/api"
npmVersion: ${CLIENT_LIBRARY_VERSION}
enumUnknownDefaultCase: true
supportsES6: true
withNodeImports: true
axiosVersion: ^1.7.4
Expand Down
2 changes: 1 addition & 1 deletion generators/typescript-axios/templates/SHA256SUM
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
e13ee7c0cad9a79bab00e8b2a7942bc5a78f63115ece3dfd71a6472bdb02dd22 ./README.mustache
3a077701e62c4d0942657c78cf0116cbe58436e34d723d81aaed7ed0d56d2ed1 ./api.mustache
244ce751d42c4d1ab2eadb28dbe6744e4e5a7c934ffde2eae9bf25b77ef12d49 ./apiInner.mustache
d8d68213e1a9a9983f89f688aaf31360f69d34a871cab4fc94f59a40279b13d9 ./configuration.mustache
fd915ea5c76b1a1c7911d02f4d2260815ec3c8f61073ee5ac443f1d534c28d29 ./configuration.mustache
5030fcd1954b4d981f2d06fce4900fe29c97c7b74ee66f2eb5f45e81b9252a94 ./index.mustache
ddc15a816c127736387e9ad99dfa9e965c587ff80b599b286e0d614e69c602e0 ./package.mustache
89b381b068d1849cc98721643c923ee153a5bdd69e19306dda59114ba0a2e243 ./tsconfig.mustache
7 changes: 5 additions & 2 deletions generators/typescript-axios/templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ export class Configuration {

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

Expand Down
2 changes: 1 addition & 1 deletion shell/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COMMON_CONFIG_FILE="generators/common/config.yaml"
GENERATORS=${*:-`find generators -name 'config.yaml' -exec dirname {} \; | sed 's/generators\///'`}
GENERATED_CONFIG_FILES=""
OPENAPI_GENERATOR_VERSION=${OPENAPI_GENERATOR_VERSION:-v7.10.0}
OPENAPI_GENERATOR_VERSION=${OPENAPI_GENERATOR_VERSION:-v7.11.0}
OPENAPI_GENERATOR_COMMAND=${OPENAPI_GENERATOR_COMMAND:-\
docker run --rm -v "$(pwd):/local" -w /local \
openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_VERSION}}
Expand Down

0 comments on commit db5a1b5

Please sign in to comment.