Skip to content

Commit b1623f7

Browse files
committed
Fix diff; update php-nextgen sample
1 parent a54b22d commit b1623f7

11 files changed

Lines changed: 1322 additions & 509 deletions

File tree

modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,75 @@ paths:
13391339
application/json:
13401340
schema:
13411341
$ref: '#/components/schemas/EnumClass'
1342+
/fake/with_400_response/endpoint:
1343+
post:
1344+
tags:
1345+
- fake
1346+
summary: test endpoint with 400 response http code with dataType
1347+
operationId: fake-with_400_response-endpoint
1348+
responses:
1349+
200:
1350+
description: Valid status value
1351+
content:
1352+
application/json:
1353+
schema:
1354+
$ref: '#/components/schemas/Pet'
1355+
'400':
1356+
description: Invalid status value
1357+
content:
1358+
application/json:
1359+
schema:
1360+
$ref: '#/components/schemas/ErrorResponse'
1361+
requestBody:
1362+
$ref: '#/components/requestBodies/Pet'
1363+
/fake/with_4xx_range_response/endpoint:
1364+
post:
1365+
tags:
1366+
- fake
1367+
summary: test endpoint with 400-499 range response http code with dataType
1368+
operationId: fake-with_4xx_range_response-endpoint
1369+
responses:
1370+
200:
1371+
description: Valid status value
1372+
content:
1373+
application/json:
1374+
schema:
1375+
$ref: '#/components/schemas/Pet'
1376+
'4xx':
1377+
description: Range of HTTP code 400-499
1378+
content:
1379+
application/json:
1380+
schema:
1381+
$ref: '#/components/schemas/ErrorResponse'
1382+
requestBody:
1383+
$ref: '#/components/requestBodies/Pet'
1384+
/fake/with_400_and_4xx_range_response/endpoint:
1385+
post:
1386+
tags:
1387+
- fake
1388+
summary: test endpoint with 400 and 400-499 range response http code with dataType
1389+
operationId: fake-with_400_and_4xx_range_response-endpoint
1390+
responses:
1391+
200:
1392+
description: Valid status value
1393+
content:
1394+
application/json:
1395+
schema:
1396+
$ref: '#/components/schemas/Pet'
1397+
'400':
1398+
description: Invalid status value
1399+
content:
1400+
application/json:
1401+
schema:
1402+
$ref: '#/components/schemas/ErrorResponse'
1403+
'4xx':
1404+
description: Range of HTTP code 400-499
1405+
content:
1406+
application/json:
1407+
schema:
1408+
$ref: '#/components/schemas/ErrorResponse'
1409+
requestBody:
1410+
$ref: '#/components/requestBodies/Pet'
13421411
servers:
13431412
- url: 'http://{server}.swagger.io:{port}/v2'
13441413
description: petstore server
@@ -2118,3 +2187,10 @@ components:
21182187
- The word one
21192188
- The digit two
21202189
- The digit three prefixed by a space
2190+
ErrorResponse:
2191+
type: object
2192+
properties:
2193+
response_code:
2194+
type: integer
2195+
error:
2196+
type: string

samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ docs/Model/EnumArrays.md
3030
docs/Model/EnumClass.md
3131
docs/Model/EnumTest.md
3232
docs/Model/EnumWithNameAndDescription.md
33+
docs/Model/ErrorResponse.md
3334
docs/Model/FakeBigDecimalMap200Response.md
3435
docs/Model/File.md
3536
docs/Model/FileSchemaTestClass.md
@@ -94,6 +95,7 @@ src/Model/EnumArrays.php
9495
src/Model/EnumClass.php
9596
src/Model/EnumTest.php
9697
src/Model/EnumWithNameAndDescription.php
98+
src/Model/ErrorResponse.php
9799
src/Model/FakeBigDecimalMap200Response.php
98100
src/Model/File.php
99101
src/Model/FileSchemaTestClass.php
@@ -128,3 +130,4 @@ src/Model/Tag.php
128130
src/Model/TestInlineFreeformAdditionalPropertiesRequest.php
129131
src/Model/User.php
130132
src/ObjectSerializer.php
133+
tests/Model/ErrorResponseTest.php

samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Class | Method | HTTP request | Description
8282
*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
8383
*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
8484
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/Api/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
85+
*FakeApi* | [**fakeWith400And4xxRangeResponseEndpoint**](docs/Api/FakeApi.md#fakewith400and4xxrangeresponseendpoint) | **POST** /fake/with_400_and_4xx_range_response/endpoint | test endpoint with 400 and 400-499 range response http code with dataType
86+
*FakeApi* | [**fakeWith400ResponseEndpoint**](docs/Api/FakeApi.md#fakewith400responseendpoint) | **POST** /fake/with_400_response/endpoint | test endpoint with 400 response http code with dataType
87+
*FakeApi* | [**fakeWith4xxRangeResponseEndpoint**](docs/Api/FakeApi.md#fakewith4xxrangeresponseendpoint) | **POST** /fake/with_4xx_range_response/endpoint | test endpoint with 400-499 range response http code with dataType
8588
*FakeApi* | [**testAdditionalPropertiesReference**](docs/Api/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
8689
*FakeApi* | [**testBodyWithBinary**](docs/Api/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
8790
*FakeApi* | [**testBodyWithFileSchema**](docs/Api/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
@@ -140,6 +143,7 @@ Class | Method | HTTP request | Description
140143
- [EnumClass](docs/Model/EnumClass.md)
141144
- [EnumTest](docs/Model/EnumTest.md)
142145
- [EnumWithNameAndDescription](docs/Model/EnumWithNameAndDescription.md)
146+
- [ErrorResponse](docs/Model/ErrorResponse.md)
143147
- [FakeBigDecimalMap200Response](docs/Model/FakeBigDecimalMap200Response.md)
144148
- [File](docs/Model/File.md)
145149
- [FileSchemaTestClass](docs/Model/FileSchemaTestClass.md)

samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Api/FakeApi.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati
1313
| [**fakeOuterNumberSerialize()**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | |
1414
| [**fakeOuterStringSerialize()**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
1515
| [**fakePropertyEnumIntegerSerialize()**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | |
16+
| [**fakeWith400And4xxRangeResponseEndpoint()**](FakeApi.md#fakeWith400And4xxRangeResponseEndpoint) | **POST** /fake/with_400_and_4xx_range_response/endpoint | test endpoint with 400 and 400-499 range response http code with dataType |
17+
| [**fakeWith400ResponseEndpoint()**](FakeApi.md#fakeWith400ResponseEndpoint) | **POST** /fake/with_400_response/endpoint | test endpoint with 400 response http code with dataType |
18+
| [**fakeWith4xxRangeResponseEndpoint()**](FakeApi.md#fakeWith4xxRangeResponseEndpoint) | **POST** /fake/with_4xx_range_response/endpoint | test endpoint with 400-499 range response http code with dataType |
1619
| [**testAdditionalPropertiesReference()**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
1720
| [**testBodyWithBinary()**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | |
1821
| [**testBodyWithFileSchema()**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | |
@@ -530,6 +533,168 @@ No authorization required
530533
[[Back to Model list]](../../README.md#models)
531534
[[Back to README]](../../README.md)
532535

536+
## `fakeWith400And4xxRangeResponseEndpoint()`
537+
538+
```php
539+
fakeWith400And4xxRangeResponseEndpoint($pet): \OpenAPI\Client\Model\Pet
540+
```
541+
542+
test endpoint with 400 and 400-499 range response http code with dataType
543+
544+
### Example
545+
546+
```php
547+
<?php
548+
require_once(__DIR__ . '/vendor/autoload.php');
549+
550+
551+
552+
$apiInstance = new OpenAPI\Client\Api\FakeApi(
553+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
554+
// This is optional, `GuzzleHttp\Client` will be used as default.
555+
new GuzzleHttp\Client()
556+
);
557+
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
558+
559+
try {
560+
$result = $apiInstance->fakeWith400And4xxRangeResponseEndpoint($pet);
561+
print_r($result);
562+
} catch (Exception $e) {
563+
echo 'Exception when calling FakeApi->fakeWith400And4xxRangeResponseEndpoint: ', $e->getMessage(), PHP_EOL;
564+
}
565+
```
566+
567+
### Parameters
568+
569+
| Name | Type | Description | Notes |
570+
| ------------- | ------------- | ------------- | ------------- |
571+
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | |
572+
573+
### Return type
574+
575+
[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)
576+
577+
### Authorization
578+
579+
No authorization required
580+
581+
### HTTP request headers
582+
583+
- **Content-Type**: `application/json`, `application/xml`
584+
- **Accept**: `application/json`
585+
586+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
587+
[[Back to Model list]](../../README.md#models)
588+
[[Back to README]](../../README.md)
589+
590+
## `fakeWith400ResponseEndpoint()`
591+
592+
```php
593+
fakeWith400ResponseEndpoint($pet): \OpenAPI\Client\Model\Pet
594+
```
595+
596+
test endpoint with 400 response http code with dataType
597+
598+
### Example
599+
600+
```php
601+
<?php
602+
require_once(__DIR__ . '/vendor/autoload.php');
603+
604+
605+
606+
$apiInstance = new OpenAPI\Client\Api\FakeApi(
607+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
608+
// This is optional, `GuzzleHttp\Client` will be used as default.
609+
new GuzzleHttp\Client()
610+
);
611+
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
612+
613+
try {
614+
$result = $apiInstance->fakeWith400ResponseEndpoint($pet);
615+
print_r($result);
616+
} catch (Exception $e) {
617+
echo 'Exception when calling FakeApi->fakeWith400ResponseEndpoint: ', $e->getMessage(), PHP_EOL;
618+
}
619+
```
620+
621+
### Parameters
622+
623+
| Name | Type | Description | Notes |
624+
| ------------- | ------------- | ------------- | ------------- |
625+
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | |
626+
627+
### Return type
628+
629+
[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)
630+
631+
### Authorization
632+
633+
No authorization required
634+
635+
### HTTP request headers
636+
637+
- **Content-Type**: `application/json`, `application/xml`
638+
- **Accept**: `application/json`
639+
640+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
641+
[[Back to Model list]](../../README.md#models)
642+
[[Back to README]](../../README.md)
643+
644+
## `fakeWith4xxRangeResponseEndpoint()`
645+
646+
```php
647+
fakeWith4xxRangeResponseEndpoint($pet): \OpenAPI\Client\Model\Pet
648+
```
649+
650+
test endpoint with 400-499 range response http code with dataType
651+
652+
### Example
653+
654+
```php
655+
<?php
656+
require_once(__DIR__ . '/vendor/autoload.php');
657+
658+
659+
660+
$apiInstance = new OpenAPI\Client\Api\FakeApi(
661+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
662+
// This is optional, `GuzzleHttp\Client` will be used as default.
663+
new GuzzleHttp\Client()
664+
);
665+
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
666+
667+
try {
668+
$result = $apiInstance->fakeWith4xxRangeResponseEndpoint($pet);
669+
print_r($result);
670+
} catch (Exception $e) {
671+
echo 'Exception when calling FakeApi->fakeWith4xxRangeResponseEndpoint: ', $e->getMessage(), PHP_EOL;
672+
}
673+
```
674+
675+
### Parameters
676+
677+
| Name | Type | Description | Notes |
678+
| ------------- | ------------- | ------------- | ------------- |
679+
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | |
680+
681+
### Return type
682+
683+
[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)
684+
685+
### Authorization
686+
687+
No authorization required
688+
689+
### HTTP request headers
690+
691+
- **Content-Type**: `application/json`, `application/xml`
692+
- **Accept**: `application/json`
693+
694+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
695+
[[Back to Model list]](../../README.md#models)
696+
[[Back to README]](../../README.md)
697+
533698
## `testAdditionalPropertiesReference()`
534699

535700
```php
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # ErrorResponse
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**response_code** | **int** | | [optional]
8+
**error** | **string** | | [optional]
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

0 commit comments

Comments
 (0)