Skip to content

Commit

Permalink
Upgrade OpenAPI generator to v7.9.0 (was v7.8.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido committed Oct 17, 2024
1 parent e5ff99a commit fdcac3b
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 43 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.8.0
image: openapitools/openapi-generator-cli:v7.9.0
env:
OPENAPI_GENERATOR_COMMAND: docker-entrypoint.sh
BUMP_CLIENT_LIBRARY_VERSION: ${{ inputs.type-of-change }}
Expand Down
4 changes: 2 additions & 2 deletions generators/java/okhttp-gson/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

16502193337397367078434a27f67edfc6410f4c06d12db876155885d6a49394 ./README.mustache
9866a9e83531d72f155a0fdea252cfe5d340deea3d6e2da7eb64c941dc88577a ./libraries/okhttp-gson/ApiClient.mustache
1cf200f8d6f6a64eb2f0d88169691b5702dc944e801c615d02db33daee46c55c ./libraries/okhttp-gson/api.mustache
7db4829dd39d1e769cfe38a07e976684f71e5db4077030ea1b423703958da223 ./libraries/okhttp-gson/api.mustache
0e77feaf2d6b0818194161ac7e621189aa6e7900b45d46fa4ff1232894bb1a7a ./libraries/okhttp-gson/oneof_model.mustache
f20b6129f3b473ecaa4e39f760bb1028d6c1f832928fa2f460131e2c54d66ed0 ./libraries/okhttp-gson/pojo.mustache
5866ce4047537e9b5d1038155599b8bad2f13a523ff5710ec29f16c6122ac7d7 ./libraries/okhttp-gson/pom.mustache
2f63581598dd2ba1373a51c0c3dfbcfa2a43d25f278a048c04c6679ef03f1224 ./libraries/okhttp-gson/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import io.swagger.v3.oas.models.parameters.Parameter;
import java.io.IOException;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.ValidatorFactory;
import jakarta.validation.executable.ExecutableValidator;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.Validation;
import {{javaxPackage}}.validation.ValidatorFactory;
import {{javaxPackage}}.validation.executable.ExecutableValidator;
import java.util.Set;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,15 @@
{{/joda}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#performBeanValidation}}
<jakarta.el-version>3.0.3</jakarta.el-version>
{{/performBeanValidation}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.3</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<jakarta.ws.rs-api-version>2.1.6</jakarta.ws.rs-api-version>
Expand Down
4 changes: 4 additions & 0 deletions generators/php/templates/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ class ObjectSerializer
case 'boolean':
return !in_array($value, [false, 0], true);
# For string values, '' is considered empty.
case 'string':
return $value === '';
# For all the other types, any value at this point can be considered empty.
default:
return true;
Expand Down
2 changes: 1 addition & 1 deletion generators/php/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

bb92a3f3107664c296ebc45c75bff7c88abf8b765565f4656a05e24234cb6d67 ./Configuration.mustache
270c3ec9312d3cb2c5317a1df29ffb5365ff8624f1d165a1e9e356b4ea57a7f3 ./ObjectSerializer.mustache
76386901de81eba7d06fa8be77fc23e319bf7deb904cce3eea7edab7bdfb55ad ./ObjectSerializer.mustache
8eebaed003795c011df87fecd1f89c630dd3f23282d80e7f407f62009e2cd0ee ./README.mustache
2d94750ad5d913f8b7fbba24681c7cc1d75e96c89ec46c379e6625c825b39020 ./model_generic.mustache
37d3333c7c3dbc6f6bffe64ce076bc512a2a1e61e986738c8e023bb745168e9a ./phpunit.xml.mustache
6 changes: 3 additions & 3 deletions generators/python/urllib3/templates/SHA256SUM
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
47fdf5141b3d999914c33faff1626c6ac2f00f87fcf9653814084f1dc67351d9 ./README.mustache
6a196e67020d765512f0c8c88afc39ef9d3cacdd50a9eba6731a6dbb1997c6e5 ./__init__package.mustache
2001a188ffeaeb931e2272f56445bfdb83f078bf2deeb7868021d8a321c3ce8f ./configuration.mustache
5b0f4e5cf6a265530e0c63089e02c61b4b43e20a99859e615a4add2017479cdb ./pyproject.mustache
69560729b13101b6b24b76497e63fa28a813772c17efc9e62b49976e083a9f31 ./rest.mustache
911e968c3503210fccd044a47de5dc833564ac41d08e3f386cd88d772cfa1488 ./setup.mustache
5e1131256ad0adbae73204efd8932db30b808b99cfd2ffde6be6ec60ed690fac ./pyproject.mustache
47d0cfca6043fc2c8bd2b5a09704e22b6a412c9ed425c3a83b6ab719cc129986 ./rest.mustache
bdd482446d4f3601bebe6fb59dba40748d9e59dc709e9033a354802ff8187eeb ./setup.mustache
26 changes: 13 additions & 13 deletions generators/python/urllib3/templates/pyproject.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ description = "Python library for the Onfido API" {{! customized
authors = ["OpenAPI Generator Community <{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}>"] {{! removed infoName field since wronlgy set }}
license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}"
readme = "README.md"
repository = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}"
repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}"
keywords = ["OpenAPI", "OpenAPI-Generator", "onfido", "identity"] {{! cutomized keywords }}
include = ["{{packageName}}/py.typed"]
packages = [{ include = "{{{packageName}}}" }]

{{! Added section }}
[tool.poetry.urls]
"Onfido API documentation" = "{{ documentationUrl }}"

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"

urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
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"
pycryptodome = ">= 3.9.0"
{{/hasHttpSignatureMethods}}
pydantic = ">=2"
typing-extensions = ">=4.7.1"
pydantic = ">= 2"
typing-extensions = ">= 4.7.1"

[tool.poetry.dev-dependencies]
pytest = ">=7.2.1"
tox = ">=3.9.0"
flake8 = ">=4.0.0"
types-python-dateutil = ">=2.8.19.14"
mypy = "1.4.1"
pytest = ">= 7.2.1"
pytest-cov = ">= 2.8.1"
tox = ">= 3.9.0"
flake8 = ">= 4.0.0"
types-python-dateutil = ">= 2.8.19.14"
mypy = ">= 1.5"


[build-system]
Expand Down
2 changes: 1 addition & 1 deletion generators/python/urllib3/templates/rest.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class RESTClientObject:
headers=headers,
preload_content=False
)
elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool):
elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
request_body = "true" if body else "false"
r = self.pool_manager.request(
method,
Expand Down
14 changes: 7 additions & 7 deletions generators/python/urllib3/templates/setup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ from setuptools import setup, find_packages # noqa: H301
# http://pypi.python.org/pypi/setuptools
NAME = "{{{projectName}}}-python" {{! package name updated with -python suffix }}
VERSION = "{{packageVersion}}"
PYTHON_REQUIRES = ">=3.7"
PYTHON_REQUIRES = ">= 3.8"
{{#apiInfo}}
{{#apis}}
{{#-last}}
REQUIRES = [
"urllib3 >= 1.25.3, < 2.1.0",
"python-dateutil",
"urllib3 >= 1.25.3, < 3.0.0",
"python-dateutil >= 2.8.2",
{{#asyncio}}
"aiohttp >= 3.0.0",
"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",
"pycryptodome>=3.9.0",
"pem >= 19.3.0",
"pycryptodome >= 3.9.0",
{{/hasHttpSignatureMethods}}
"pydantic >= 2",
"typing-extensions >= 4.7.1",
Expand Down
4 changes: 2 additions & 2 deletions generators/ruby/faraday/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

631eea1aeb59eff826cd4975334d66bdf7ad14d3feacdf35ed5b07f33548981e ./Gemfile.mustache
88dc22838f416232553b387453a2ebecf01d66508d8657d5313320cc03ceb6a2 ./README.mustache
0770a6caea12e1d33baf4eafc3bbbf5ec4325be84c776b64f966956c3e4e68eb ./configuration.mustache
0394740e8dc344748f61724a7fb304c23daf1e66922efa995c195968a0919ef4 ./README.mustache
8d952d2c3d4d49e0811a470b7e5e8c7c8dc798cf2f32e69d4501fc26be91a29a ./configuration.mustache
e66f0139c35c8b1d88c19787b2379ee9e6857ced963624c9a945ee68f3b41b2f ./gemspec.mustache
2 changes: 1 addition & 1 deletion generators/ruby/faraday/templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module {{moduleName}}
type: 'api_key',
in: {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
key: '{{keyParamName}}',
value: api_key_with_prefix('{{name}}'{{#vendorExtensions.x-auth-id-alias}}, '{{.}}'{{/vendorExtensions.x-auth-id-alias}})
value: api_key_with_prefix('{{name}}'{{#vendorExtensions.x-auth-id-alias}}, '{{.}}'{{/vendorExtensions.x-auth-id-alias}}){{! Use name instead of keyParamName }}
},
{{/isApiKey}}
{{#isBasic}}
Expand Down
2 changes: 1 addition & 1 deletion generators/typescript-axios/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

e13ee7c0cad9a79bab00e8b2a7942bc5a78f63115ece3dfd71a6472bdb02dd22 ./README.mustache
3a077701e62c4d0942657c78cf0116cbe58436e34d723d81aaed7ed0d56d2ed1 ./api.mustache
1d4051cca5592db765d1f83133b10abf12cc19ef3c53690da1018c142a83727b ./apiInner.mustache
00efb349f77aed31bd52a6cea64d3b32d4713bc24399b377883ec28b5b38b24a ./apiInner.mustache
d8d68213e1a9a9983f89f688aaf31360f69d34a871cab4fc94f59a40279b13d9 ./configuration.mustache
5030fcd1954b4d981f2d06fce4900fe29c97c7b74ee66f2eb5f45e81b9252a94 ./index.mustache
62bbc44c32ed454a215fc76636eaca819f012b65486485fda7499f7937557cc4 ./package.mustache
Expand Down
14 changes: 13 additions & 1 deletion generators/typescript-axios/templates/apiInner.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,27 @@ export interface {{classname}}Interface {
{{#summary}}
* @summary {{&summary}}
{{/summary}}
{{#useSingleRequestParameter}}
{{#allParams.0}}
* @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters.
{{/allParams.0}}
{{/useSingleRequestParameter}}
{{^useSingleRequestParameter}}
{{#allParams}}
* @param {{=<% %>=}}{<%#isEnum%><%&datatypeWithEnum%><%/isEnum%><%^isEnum%><%&dataType%><%#isNullable%> | null<%/isNullable%><%/isEnum%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}}
{{/allParams}}
{{/useSingleRequestParameter}}
* @param {*} [options] Override http request option.{{#isDeprecated}}
* @deprecated{{/isDeprecated}}
* @throws {RequiredError}
* @memberof {{classname}}Interface
*/
{{#useSingleRequestParameter}}
{{nickname}}({{#allParams.0}}requestParameters{{^hasRequiredParams}}?{{/hasRequiredParams}}: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}>;
{{/useSingleRequestParameter}}
{{^useSingleRequestParameter}}
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}>;
{{/useSingleRequestParameter}}

{{/operation}}
}
Expand Down Expand Up @@ -454,4 +466,4 @@ export type {{operationIdCamelCase}}{{enumName}} = typeof {{operationIdCamelCase
{{/isEnum}}
{{/allParams}}
{{/operation}}
{{/operations}}
{{/operations}}
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.8.0}
OPENAPI_GENERATOR_VERSION=${OPENAPI_GENERATOR_VERSION:-v7.9.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 fdcac3b

Please sign in to comment.