Skip to content

Commit 36496bb

Browse files
authored
Merge pull request #30 from DoclerLabs/only-add-needed-content-type-serializers
only add needed content type serializers
2 parents 8da1831 + 1a436c7 commit 36496bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+187
-201
lines changed

.php_cs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'array_syntax' => ['syntax' => 'short'],
1414
'no_multiline_whitespace_before_semicolons' => true,
1515
'no_short_echo_tag' => true,
16+
'no_unused_imports' => true,
1617
'not_operator_with_successor_space' => true,
1718
'no_useless_else' => true,
1819
'ordered_imports' => [

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77

8+
## [5.1.0] - 2021-04-02
9+
### Changed
10+
- Only content type serializers which are used are included
11+
812
## [5.0.0] - 2021-02-15
913
### Changed
1014
- By default, the PHP version used in the generated client is 7.4.

example/gen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docker run -it \
1111
-e OPENAPI=/openapi.yaml \
1212
-e OUTPUT_DIR=/client \
1313
-e PACKAGE=openapi/pet-store-client \
14-
-e CLIENT_PHP_VERSION=7.2 \
14+
-e CLIENT_PHP_VERSION=7.4 \
1515
dhlabs/api-client-generator
1616
```
1717

example/gen/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sort-packages": true
99
},
1010
"require": {
11-
"php": ">=7.2",
11+
"php": ">=7.4",
1212
"docler-labs/api-client-exception": "^1.0",
1313
"guzzlehttp/psr7": "^1.6",
1414
"pimple/pimple": "^3.3",

example/gen/src/Request/AddPetRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
class AddPetRequest implements RequestInterface
1414
{
15-
/** @var Pet */
16-
private $pet;
15+
private Pet $pet;
1716

18-
/** @var string */
19-
private $contentType;
17+
private string $contentType;
2018

2119
public function __construct(Pet $pet, string $contentType)
2220
{

example/gen/src/Request/CreateUserRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
class CreateUserRequest implements RequestInterface
1414
{
15-
/** @var User */
16-
private $user;
15+
private User $user;
1716

18-
/** @var string */
19-
private $contentType;
17+
private string $contentType;
2018

2119
public function __construct(User $user, string $contentType)
2220
{

example/gen/src/Request/CreateUsersWithListInputRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
class CreateUsersWithListInputRequest implements RequestInterface
1414
{
15-
/** @var UserCollection */
16-
private $createUsersWithListInputRequestBody;
15+
private UserCollection $createUsersWithListInputRequestBody;
1716

18-
/** @var string */
19-
private $contentType = 'application/json';
17+
private string $contentType = 'application/json';
2018

2119
public function __construct(UserCollection $createUsersWithListInputRequestBody)
2220
{

example/gen/src/Request/DeleteOrderRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010

1111
class DeleteOrderRequest implements RequestInterface
1212
{
13-
/** @var int */
14-
private $orderId;
13+
private int $orderId;
1514

16-
/** @var string */
17-
private $contentType = '';
15+
private string $contentType = '';
1816

1917
public function __construct(int $orderId)
2018
{

example/gen/src/Request/DeletePetRequest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@
1212

1313
class DeletePetRequest implements RequestInterface
1414
{
15-
/** @var string|null */
16-
private $apiKey;
15+
private ?string $apiKey = null;
1716

18-
/** @var int */
19-
private $petId;
17+
private int $petId;
2018

21-
/** @var string */
22-
private $contentType = '';
19+
private string $contentType = '';
2320

2421
public function __construct(int $petId)
2522
{

example/gen/src/Request/DeleteUserRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010

1111
class DeleteUserRequest implements RequestInterface
1212
{
13-
/** @var string */
14-
private $username;
13+
private string $username;
1514

16-
/** @var string */
17-
private $contentType = '';
15+
private string $contentType = '';
1816

1917
public function __construct(string $username)
2018
{

0 commit comments

Comments
 (0)