Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<Mo
}

if (phpReturnTypeOptions.isEmpty()) {
operation.vendorExtensions.putIfAbsent("x-php-return-type-is-void", true);
operation.vendorExtensions.putIfAbsent("x-php-return-type", "void");
operation.vendorExtensions.putIfAbsent("x-php-doc-return-type", "void");
} else {
operation.vendorExtensions.putIfAbsent("x-php-return-type-is-void", false);
operation.vendorExtensions.putIfAbsent("x-php-return-type", String.join("|", phpReturnTypeOptions));
operation.vendorExtensions.putIfAbsent("x-php-doc-return-type", String.join("|", docReturnTypeOptions));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ use {{invokerPackage}}\ObjectSerializer;
{{/vendorExtensions.x-group-parameters}}
): {{{vendorExtensions.x-php-return-type}}}
{
{{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}}
return $response;{{/returnType}}
{{^vendorExtensions.x-php-return-type-is-void}}list($response) = {{/vendorExtensions.x-php-return-type-is-void}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{^vendorExtensions.x-php-return-type-is-void}}
return $response;{{/vendorExtensions.x-php-return-type-is-void}}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,51 @@ paths:
description: Range of HTTP code 400-499
requestBody:
$ref: '#/components/requestBodies/Pet'
"/error":
get:
summary: Will always generate an error
operationId: error
responses: &commonErrors
"400":
description: The supplied request was not valid
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: Requested item was not found
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"422":
description: The input to the operation was not valid
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/fake/pet/{pet_id}":
delete:
operationId: fakeDeletePet
tags:
- fake
parameters:
- name: pet_id
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
responses:
"204":
description: "Returns 204 No Content on success."
<<: *commonErrors
servers:
- url: 'http://{server}.swagger.io:{port}/v2'
description: petstore server
Expand Down Expand Up @@ -2230,3 +2275,18 @@ components:
type: integer
error:
type: string

Error:
title: Error
description: "Returned when the server encounters an error, either in client input or internally"
properties:
error:
type: string
description: "A human readable error message"
errors:
type: array
items:
type: string
description: "Optional array of multiple errors encountered during processing"
required:
- error
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ docs/Model/EnumArrays.md
docs/Model/EnumClass.md
docs/Model/EnumTest.md
docs/Model/EnumWithNameAndDescription.md
docs/Model/Error.md
docs/Model/ErrorResponse.md
docs/Model/FakeBigDecimalMap200Response.md
docs/Model/File.md
Expand Down Expand Up @@ -94,6 +95,7 @@ src/Model/EnumArrays.php
src/Model/EnumClass.php
src/Model/EnumTest.php
src/Model/EnumWithNameAndDescription.php
src/Model/Error.php
src/Model/ErrorResponse.php
src/Model/FakeBigDecimalMap200Response.php
src/Model/File.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**error**](docs/Api/DefaultApi.md#error) | **GET** /error | Will always generate an error
*DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo |
*FakeApi* | [**fakeBigDecimalMap**](docs/Api/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap |
*FakeApi* | [**fakeDeletePet**](docs/Api/FakeApi.md#fakedeletepet) | **DELETE** /fake/pet/{pet_id} |
*FakeApi* | [**fakeEnumEndpoint**](docs/Api/FakeApi.md#fakeenumendpoint) | **GET** /fake/enum/endpoint | test endpoint with enum parameter
*FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
Expand Down Expand Up @@ -145,6 +147,7 @@ Class | Method | HTTP request | Description
- [EnumClass](docs/Model/EnumClass.md)
- [EnumTest](docs/Model/EnumTest.md)
- [EnumWithNameAndDescription](docs/Model/EnumWithNameAndDescription.md)
- [Error](docs/Model/Error.md)
- [ErrorResponse](docs/Model/ErrorResponse.md)
- [FakeBigDecimalMap200Response](docs/Model/FakeBigDecimalMap200Response.md)
- [File](docs/Model/File.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,60 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**error()**](DefaultApi.md#error) | **GET** /error | Will always generate an error |
| [**fooGet()**](DefaultApi.md#fooGet) | **GET** /foo | |


## `error()`

```php
error()
```

Will always generate an error

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);

try {
$apiInstance->error();
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->error: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `fooGet()`

```php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**fakeBigDecimalMap()**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | |
| [**fakeDeletePet()**](FakeApi.md#fakeDeletePet) | **DELETE** /fake/pet/{pet_id} | |
| [**fakeEnumEndpoint()**](FakeApi.md#fakeEnumEndpoint) | **GET** /fake/enum/endpoint | test endpoint with enum parameter |
| [**fakeHealthGet()**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
| [**fakeHttpSignatureTest()**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication |
Expand Down Expand Up @@ -87,6 +88,59 @@ No authorization required
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `fakeDeletePet()`

```php
fakeDeletePet($pet_id)
```



### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\FakeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$pet_id = 'pet_id_example'; // string | The id of the pet to retrieve

try {
$apiInstance->fakeDeletePet($pet_id);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->fakeDeletePet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **pet_id** | **string**| The id of the pet to retrieve | |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `fakeEnumEndpoint()`

```php
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# # Error

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **string** | A human readable error message |
**errors** | **string[]** | Optional array of multiple errors encountered during processing | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Loading
Loading