Skip to content

Commit

Permalink
Update OpenAPI generator version to 7.6.0 (was 7.5.0) (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido authored Jun 7, 2024
1 parent c6ba410 commit 169dd4d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 276 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 @@ -69,7 +69,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.5.0
image: openapitools/openapi-generator-cli:v7.6.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,5 +1,5 @@

16502193337397367078434a27f67edfc6410f4c06d12db876155885d6a49394 ./README.mustache
7b635a5f3fcc4cb2ace38f0dd0ca8252a78090e592a6c35fe5a08f7bc407ef6b ./libraries/okhttp-gson/ApiClient.mustache
0e06162937a3175d59b3bdb9fa249de9888ea0d0a06cfbae543f53720ff706e5 ./libraries/okhttp-gson/oneof_model.mustache
ee73f2440b54f85d91dfd65350167639e770c0d85e75690a8f797852852ec516 ./libraries/okhttp-gson/pom.mustache
0e77feaf2d6b0818194161ac7e621189aa6e7900b45d46fa4ff1232894bb1a7a ./libraries/okhttp-gson/oneof_model.mustache
e83ff873cc6a5a7e064b4732ab4bfbb3fa32660d015b9ca1b6bdb5884335c506 ./libraries/okhttp-gson/pom.mustache
76 changes: 59 additions & 17 deletions generators/php/templates/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -538,22 +538,64 @@ class ObjectSerializer
}

/**
* Native `http_build_query` wrapper.
* @see https://www.php.net/manual/en/function.http-build-query
*
* @param array|object $data May be an array or object containing properties.
* @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only.
* @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter.
* @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738.
*
* @return string
*/
public static function buildQuery(
$data,
string $numeric_prefix = '',
?string $arg_separator = null,
int $encoding_type = \PHP_QUERY_RFC3986
): string {
return \GuzzleHttp\Psr7\Query::build($data, $encoding_type);
* Build a query string from an array of key value pairs.
*
* This function can use the return value of `parse()` to build a query
* string. This function does not modify the provided keys when an array is
* encountered (like `http_build_query()` would).
*
* The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112
* with a modification which is described in https://github.com/guzzle/psr7/pull/603
*
* @param array $params Query string parameters.
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
* to encode using RFC3986, or PHP_QUERY_RFC1738
* to encode using RFC1738.
*/
public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string
{
if (!$params) {
return '';
}

if ($encoding === false) {
$encoder = function (string $str): string {
return $str;
};
} elseif ($encoding === PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode';
} elseif ($encoding === PHP_QUERY_RFC1738) {
$encoder = 'urlencode';
} else {
throw new \InvalidArgumentException('Invalid type');
}

$castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()
? function ($v) { return (int) $v; }
: function ($v) { return $v ? 'true' : 'false'; };

$qs = '';
foreach ($params as $k => $v) {
$k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
$v = is_bool($v) ? $castBool($v) : $v;
if ($v !== null) {
$qs .= '='.$encoder((string) $v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
$vv = is_bool($vv) ? $castBool($vv) : $vv;
if ($vv !== null) {
$qs .= '='.$encoder((string) $vv);
}
$qs .= '&';
}
}
}

return $qs ? (string) substr($qs, 0, -1) : '';
}
}
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
4d5302fc21ddf1cd79e009a18bcb162d7a95f850d21d67461c7beab5acc09a19 ./ObjectSerializer.mustache
557173b27efb57eeba6187b8b64963a49964ade8f5f6418bd514ece483f392dd ./ObjectSerializer.mustache
8eebaed003795c011df87fecd1f89c630dd3f23282d80e7f407f62009e2cd0ee ./README.mustache
2d94750ad5d913f8b7fbba24681c7cc1d75e96c89ec46c379e6625c825b39020 ./model_generic.mustache
37d3333c7c3dbc6f6bffe64ce076bc512a2a1e61e986738c8e023bb745168e9a ./phpunit.xml.mustache
1 change: 0 additions & 1 deletion generators/ruby/faraday/templates/SHA256SUM
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

631eea1aeb59eff826cd4975334d66bdf7ad14d3feacdf35ed5b07f33548981e ./Gemfile.mustache
88dc22838f416232553b387453a2ebecf01d66508d8657d5313320cc03ceb6a2 ./README.mustache
3748b0448b9a3e4f899c9faf72fedd3e378f840353422e475e0ad828d78b4d64 ./api_client.mustache
b9af426fa4b72082dad184722e97c61366cceab0d247b477b2834e38aa6c3411 ./configuration.mustache
e66f0139c35c8b1d88c19787b2379ee9e6857ced963624c9a945ee68f3b41b2f ./gemspec.mustache
248 changes: 0 additions & 248 deletions generators/ruby/faraday/templates/api_client.mustache

This file was deleted.

2 changes: 1 addition & 1 deletion generators/typescript-axios/templates/SHA256SUM
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
e13ee7c0cad9a79bab00e8b2a7942bc5a78f63115ece3dfd71a6472bdb02dd22 ./README.mustache
d8d68213e1a9a9983f89f688aaf31360f69d34a871cab4fc94f59a40279b13d9 ./configuration.mustache
5030fcd1954b4d981f2d06fce4900fe29c97c7b74ee66f2eb5f45e81b9252a94 ./index.mustache
c7e61e2b36fbf70d84b75162b09b4f571466b59d0b72c7f1e3e517c6d7342622 ./package.mustache
28f5e210e99474200c8e5f13e4f2374c1556406eb71c15e808d81913000cd549 ./package.mustache
89b381b068d1849cc98721643c923ee153a5bdd69e19306dda59114ba0a2e243 ./tsconfig.mustache
8 changes: 4 additions & 4 deletions generators/typescript-axios/templates/package.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"identity",
"verification",
"api"
{{! Added keywords - NED }}
{{! Added keywords - END }}
],
"license": "MIT", {{! Updated license }}
"main": "./dist/index.js",
Expand Down Expand Up @@ -62,10 +62,10 @@
"ts-jest": "^26.4.4",
"dotenv": "^16.4.5",
{{! Added dependencies for tests development - END }}
"@types/node": "^12.11.5",
"typescript": "^4.0"
"@types/node": "12.11.5 - 12.20.42",
"typescript": "^4.0 || ^5.0"
},
{{! Added block for package delivery }}
{{! Updated block for package delivery }}
"publishConfig": {
"access": "public"
}
Expand Down
Loading

0 comments on commit 169dd4d

Please sign in to comment.