Skip to content

Commit 085ccab

Browse files
committed
be ready for 204 empty responses
1 parent 11201a1 commit 085ccab

25 files changed

Lines changed: 892 additions & 382 deletions

.openapi-generator/templates/api.mustache

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -384,20 +384,26 @@ use {{invokerPackage}}\ObjectSerializer;
384384
} else {
385385
$content = (string) $response->getBody();
386386
if ($returnType !== 'string') {
387-
try {
388-
$content = json_decode($content, false, 512, \JSON_THROW_ON_ERROR);
389-
} catch (\JsonException $exception) {
390-
throw new ApiException(
391-
sprintf(
392-
'Error JSON decoding server response (%s)',
393-
$request->getUri(),
394-
),
395-
$statusCode,
396-
$response->getHeaders(),
397-
$content,
398-
);
387+
388+
if($statusCode == 204) {
389+
$content = [];
390+
} else {
391+
try {
392+
$content = json_decode($content, false, 512, \JSON_THROW_ON_ERROR);
393+
} catch (\JsonException $exception) {
394+
throw new ApiException(
395+
sprintf(
396+
'Error JSON decoding server response (%s)',
397+
$request->getUri(),
398+
),
399+
$statusCode,
400+
$response->getHeaders(),
401+
$content,
402+
);
403+
}
399404
}
400405
}
406+
401407
}
402408

403409
return [

.openapi-generator/templates/api_doc.mustache

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
11
# {{invokerPackage}}\{{classname}}{{#description}}
22

3-
{{.}}{{/description}}
3+
{{description}}{{/description}}
44

5-
All URIs are relative to {{basePath}}, except if the operation defines another base path.
5+
All URIs are relative to {{basePath}}.
66

7-
| Method | HTTP request | Description |
8-
| ------------- | ------------- | ------------- |
9-
{{#operations}}{{#operation}}| [**{{operationId}}()**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} |
7+
Method | HTTP request | Description
8+
------------- | ------------- | -------------
9+
{{#operations}}{{#operation}}[**{{operationId}}()**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
1010
{{/operation}}{{/operations}}{{#operations}}{{#operation}}
1111

1212
## `{{{operationId}}}()`
1313

1414
```php
15-
{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{.}}}{{/returnType}}
15+
{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{returnType}}}{{/returnType}}
1616
```
17-
{{#servers}}
18-
{{#-first}}
19-
### URI(s):
20-
{{/-first}}
21-
- {{{url}}} {{#description}}{{.}}{{/description}}{{#variables}}
22-
{{#-first}}
23-
- Variables:
24-
{{/-first}}
25-
- {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}}
26-
{{#-first}}
27-
- Allowed values:
28-
{{/-first}}
29-
- {{{.}}}{{/enumValues}}{{#defaultValue}}
30-
- Default value: {{{.}}}
31-
{{/defaultValue}}{{/variables}}{{/servers}}
17+
3218
{{{summary}}}{{#notes}}
3319

34-
{{{.}}}{{/notes}}
20+
{{{notes}}}{{/notes}}
3521

3622
### Example
3723

@@ -40,31 +26,23 @@ All URIs are relative to {{basePath}}, except if the operation defines another b
4026
require_once(__DIR__ . '/vendor/autoload.php');
4127

4228
{{> php_doc_auth_partial}}
43-
$apiInstance = new \{{invokerPackage}}\PremiumAPI\{{classname}}(
44-
new \VitexSoftware\Raiffeisenbank\ApiClient(['clientpubip'=> \VitexSoftware\Raiffeisenbank\ApiClient::getPublicIP() ,'debug'=>true]){{#hasAuthMethods}},
29+
$apiInstance = new {{invokerPackage}}\Api\{{classname}}(
30+
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
31+
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
32+
new GuzzleHttp\Client(){{#hasAuthMethods}},
4533
$config{{/hasAuthMethods}}
4634
);
4735
{{^vendorExtensions.x-group-parameters}}
48-
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}}
49-
{{/allParams}}{{#servers}}{{#-first}}
50-
$hostIndex = 0;
51-
$variables = [{{#variables}}
52-
'{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}}
53-
];
54-
{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}
55-
$associative_array = [
56-
{{#allParams}} '{{paramName}}' => {{{example}}}, // {{{dataType}}}{{#description}} | {{{.}}}{{/description}}
36+
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{description}}}{{/description}}
37+
{{/allParams}}
38+
{{/vendorExtensions.x-group-parameters}}
39+
{{#vendorExtensions.x-group-parameters}}
40+
{{#allParams}}$associate_array['{{paramName}}'] = {{{example}}}; // {{{dataType}}}{{#description}} | {{{description}}}{{/description}}
5741
{{/allParams}}
58-
{{#servers}}{{#-first}}
59-
'hostIndex' => 0,
60-
$variables = [{{#variables}}
61-
'{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}}
62-
],
63-
{{/-first}}{{/servers}}];
6442
{{/vendorExtensions.x-group-parameters}}
6543

6644
try {
67-
{{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}}
45+
{{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}}
6846
print_r($result);{{/returnType}}
6947
} catch (Exception $e) {
7048
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
@@ -74,15 +52,13 @@ try {
7452
### Parameters
7553

7654
{{#vendorExtensions.x-group-parameters}}
77-
Note: the input parameter is an associative array with the keys listed as the parameter names below.
55+
Note: the input parameter is an associative array with the keys listed as the parameter name below.
7856

7957
{{/vendorExtensions.x-group-parameters}}
80-
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}| Name | Type | Description | Notes |
81-
| ------------- | ------------- | ------------- | ------------- |{{/-last}}{{/allParams}}
82-
{{#allParams}}| **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} |
83-
{{/allParams}}{{#servers}}{{#-first}}| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] |
84-
| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |{{/-first}}
85-
{{/servers}}
58+
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}Name | Type | Description | Notes
59+
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
60+
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}
61+
{{/allParams}}
8662

8763
### Return type
8864

.openapi-generator/templates/composer.mustache

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"ext-curl": "*",
2929
"ext-json": "*",
3030
"ext-mbstring": "*",
31-
"guzzlehttp/guzzle": "^7.3",
32-
"guzzlehttp/psr7": "^1.7 || ^2.0",
31+
"guzzlehttp/psr7": "^1.8 || ^2.0",
3332
"vitexsoftware/ease-core": "^1.45"
3433
},
3534
"require-dev": {

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
"ext-curl": "*",
2525
"ext-json": "*",
2626
"ext-mbstring": "*",
27-
"guzzlehttp/guzzle": "^7.3",
28-
"guzzlehttp/psr7": "^1.7 || ^2.0",
27+
"guzzlehttp/psr7": "^1.8 || ^2.0",
2928
"vitexsoftware/ease-core": "^1.45"
3029
},
3130
"require-dev": {

debian/changelog

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
php-vitexsoftware-rbczpremiumapi (1.3.2) UNRELEASED; urgency=medium
1+
php-vitexsoftware-rbczpremiumapi (1.3.2) unstable; urgency=medium
22

3+
[ Vitex ]
34
* Statementor::setStatementLine() added
45

5-
-- Vitex <vitezslav.dvorak@spojenet.cz> Thu, 20 Mar 2025 20:06:18 +0100
6+
-- vitex <info@vitexsoftware.cz> Wed, 28 May 2025 13:07:55 +0200
67

78
php-vitexsoftware-rbczpremiumapi (1.3.1) unstable; urgency=medium
89

docs/Api/DownloadStatementApi.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# VitexSoftware\Raiffeisenbank\DownloadStatementApi
22

3-
All URIs are relative to https://api.rb.cz, except if the operation defines another base path.
3+
All URIs are relative to https://api.rb.cz.
44

5-
| Method | HTTP request | Description |
6-
| ------------- | ------------- | ------------- |
7-
| [**downloadStatement()**](DownloadStatementApi.md#downloadStatement) | **POST** /rbcz/premium/api/accounts/statements/download | |
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**downloadStatement()**](DownloadStatementApi.md#downloadStatement) | **POST** /rbcz/premium/api/accounts/statements/download |
88

99

1010
## `downloadStatement()`
@@ -24,8 +24,10 @@ require_once(__DIR__ . '/vendor/autoload.php');
2424

2525

2626

27-
$apiInstance = new \VitexSoftware\Raiffeisenbank\PremiumAPI\DownloadStatementApi(
28-
new \VitexSoftware\Raiffeisenbank\ApiClient(['clientpubip'=> \VitexSoftware\Raiffeisenbank\ApiClient::getPublicIP() ,'debug'=>true])
27+
$apiInstance = new VitexSoftware\Raiffeisenbank\Api\DownloadStatementApi(
28+
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
29+
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
30+
new GuzzleHttp\Client()
2931
);
3032
$xRequestId = 'xRequestId_example'; // string | Unique request id provided by consumer application for reference and auditing.
3133
$acceptLanguage = 'acceptLanguage_example'; // string | The Accept-Language request HTTP header is used to determine document language. Supported languages are `cs` and `en`.
@@ -40,11 +42,11 @@ try {
4042

4143
### Parameters
4244

43-
| Name | Type | Description | Notes |
44-
| ------------- | ------------- | ------------- | ------------- |
45-
| **xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. | |
46-
| **acceptLanguage** | **string**| The Accept-Language request HTTP header is used to determine document language. Supported languages are &#x60;cs&#x60; and &#x60;en&#x60;. | |
47-
| **requestBody** | [**\VitexSoftware\Raiffeisenbank\Model\DownloadStatementRequest**](../Model/DownloadStatementRequest.md)| | |
45+
Name | Type | Description | Notes
46+
------------- | ------------- | ------------- | -------------
47+
**xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. |
48+
**acceptLanguage** | **string**| The Accept-Language request HTTP header is used to determine document language. Supported languages are &#x60;cs&#x60; and &#x60;en&#x60;. |
49+
**requestBody** | [**\VitexSoftware\Raiffeisenbank\Model\DownloadStatementRequest**](../Model/DownloadStatementRequest.md)| |
4850

4951
### Return type
5052

docs/Api/GetAccountBalanceApi.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# VitexSoftware\Raiffeisenbank\GetAccountBalanceApi
22

3-
All URIs are relative to https://api.rb.cz, except if the operation defines another base path.
3+
All URIs are relative to https://api.rb.cz.
44

5-
| Method | HTTP request | Description |
6-
| ------------- | ------------- | ------------- |
7-
| [**getBalance()**](GetAccountBalanceApi.md#getBalance) | **GET** /rbcz/premium/api/accounts/{accountNumber}/balance | |
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getBalance()**](GetAccountBalanceApi.md#getBalance) | **GET** /rbcz/premium/api/accounts/{accountNumber}/balance |
88

99

1010
## `getBalance()`
@@ -24,8 +24,10 @@ require_once(__DIR__ . '/vendor/autoload.php');
2424

2525

2626

27-
$apiInstance = new \VitexSoftware\Raiffeisenbank\PremiumAPI\GetAccountBalanceApi(
28-
new \VitexSoftware\Raiffeisenbank\ApiClient(['clientpubip'=> \VitexSoftware\Raiffeisenbank\ApiClient::getPublicIP() ,'debug'=>true])
27+
$apiInstance = new VitexSoftware\Raiffeisenbank\Api\GetAccountBalanceApi(
28+
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
29+
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
30+
new GuzzleHttp\Client()
2931
);
3032
$xRequestId = 'xRequestId_example'; // string | Unique request id provided by consumer application for reference and auditing.
3133
$accountNumber = 'accountNumber_example'; // string | The number of account without prefix and bankCode
@@ -39,10 +41,10 @@ try {
3941

4042
### Parameters
4143

42-
| Name | Type | Description | Notes |
43-
| ------------- | ------------- | ------------- | ------------- |
44-
| **xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. | |
45-
| **accountNumber** | **string**| The number of account without prefix and bankCode | |
44+
Name | Type | Description | Notes
45+
------------- | ------------- | ------------- | -------------
46+
**xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. |
47+
**accountNumber** | **string**| The number of account without prefix and bankCode |
4648

4749
### Return type
4850

docs/Api/GetAccountsApi.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# VitexSoftware\Raiffeisenbank\GetAccountsApi
22

3-
All URIs are relative to https://api.rb.cz, except if the operation defines another base path.
3+
All URIs are relative to https://api.rb.cz.
44

5-
| Method | HTTP request | Description |
6-
| ------------- | ------------- | ------------- |
7-
| [**getAccounts()**](GetAccountsApi.md#getAccounts) | **GET** /rbcz/premium/api/accounts | |
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getAccounts()**](GetAccountsApi.md#getAccounts) | **GET** /rbcz/premium/api/accounts |
88

99

1010
## `getAccounts()`
@@ -25,8 +25,10 @@ require_once(__DIR__ . '/vendor/autoload.php');
2525

2626

2727

28-
$apiInstance = new \VitexSoftware\Raiffeisenbank\PremiumAPI\GetAccountsApi(
29-
new \VitexSoftware\Raiffeisenbank\ApiClient(['clientpubip'=> \VitexSoftware\Raiffeisenbank\ApiClient::getPublicIP() ,'debug'=>true])
28+
$apiInstance = new VitexSoftware\Raiffeisenbank\Api\GetAccountsApi(
29+
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
30+
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
31+
new GuzzleHttp\Client()
3032
);
3133
$xRequestId = 'xRequestId_example'; // string | Unique request id provided by consumer application for reference and auditing.
3234
$page = 56; // int | Number of the requested page. Default is 1.
@@ -42,11 +44,11 @@ try {
4244

4345
### Parameters
4446

45-
| Name | Type | Description | Notes |
46-
| ------------- | ------------- | ------------- | ------------- |
47-
| **xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. | |
48-
| **page** | **int**| Number of the requested page. Default is 1. | [optional] |
49-
| **size** | **int**| Number of items on the page. Default is 15. | [optional] |
47+
Name | Type | Description | Notes
48+
------------- | ------------- | ------------- | -------------
49+
**xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. |
50+
**page** | **int**| Number of the requested page. Default is 1. | [optional]
51+
**size** | **int**| Number of items on the page. Default is 15. | [optional]
5052

5153
### Return type
5254

docs/Api/GetBatchDetailApi.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# VitexSoftware\Raiffeisenbank\GetBatchDetailApi
22

3-
All URIs are relative to https://api.rb.cz, except if the operation defines another base path.
3+
All URIs are relative to https://api.rb.cz.
44

5-
| Method | HTTP request | Description |
6-
| ------------- | ------------- | ------------- |
7-
| [**getBatchDetail()**](GetBatchDetailApi.md#getBatchDetail) | **GET** /rbcz/premium/api/payments/batches/{batchFileId} | |
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getBatchDetail()**](GetBatchDetailApi.md#getBatchDetail) | **GET** /rbcz/premium/api/payments/batches/{batchFileId} |
88

99

1010
## `getBatchDetail()`
@@ -24,8 +24,10 @@ require_once(__DIR__ . '/vendor/autoload.php');
2424

2525

2626

27-
$apiInstance = new \VitexSoftware\Raiffeisenbank\PremiumAPI\GetBatchDetailApi(
28-
new \VitexSoftware\Raiffeisenbank\ApiClient(['clientpubip'=> \VitexSoftware\Raiffeisenbank\ApiClient::getPublicIP() ,'debug'=>true])
27+
$apiInstance = new VitexSoftware\Raiffeisenbank\Api\GetBatchDetailApi(
28+
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
29+
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
30+
new GuzzleHttp\Client()
2931
);
3032
$xRequestId = 'xRequestId_example'; // string | Unique request id provided by consumer application for reference and auditing.
3133
$batchFileId = 56; // int | Batch file id
@@ -39,10 +41,10 @@ try {
3941

4042
### Parameters
4143

42-
| Name | Type | Description | Notes |
43-
| ------------- | ------------- | ------------- | ------------- |
44-
| **xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. | |
45-
| **batchFileId** | **int**| Batch file id | |
44+
Name | Type | Description | Notes
45+
------------- | ------------- | ------------- | -------------
46+
**xRequestId** | **string**| Unique request id provided by consumer application for reference and auditing. |
47+
**batchFileId** | **int**| Batch file id |
4648

4749
### Return type
4850

0 commit comments

Comments
 (0)