Skip to content

Commit e5a1248

Browse files
authored
Add some type resolver details to Readme.md (#1867)
1 parent 63adcd0 commit e5a1248

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,6 @@ For cli usage from anywhere, install swagger-php globally and make sure to place
4444
composer global require zircote/swagger-php
4545
```
4646

47-
### radebatz/type-info-extras
48-
`swagger-php` version `5.5` introduces a new type resolver used internally to determine the schema type
49-
of properties (and other elements with a schema).
50-
51-
By default, a custom `LegacyTypeResolver` is used. If you are on PHP 8.2 or higher,
52-
the `TypeInfoTypeResolver` can be used instead.
53-
For this the [radebatz/type-info-extras](https://github.com/DerManoMann/type-info-extras) package is required.
54-
Since it is optional, it needs to be installed manually. It will also add `symfony/type-info` as a dependency:
55-
56-
```shell
57-
composer require radebatz/type-info-extras
58-
```
59-
60-
If the library code is detected, `swagger-php` will automatically use it.
61-
Advantages are re-use of 3rd party code, better stability and compatibility with future PHP versions.
62-
6347
### doctrine/annotations
6448
As of version `4.8` the [doctrine annotations](https://www.doctrine-project.org/projects/annotations.html) library **is optional** and **no longer installed by default**.
6549

@@ -127,6 +111,15 @@ $openapi = $serializer->deserialize($jsonString, 'OpenApi\Annotations\OpenApi');
127111
echo $openapi->toJson();
128112
```
129113

114+
## The `LegacyTypeResolver`
115+
116+
As of version 6, resolution of types is done using the `TypeInfoTypeResolver` class. It uses the `symfony/type-info`
117+
library under the hood which improves handling of complext types.
118+
119+
If this is not desired, the `LegacyTypeResolver` can be used to preserve the old behaviour of version 5.
120+
121+
The `LegacyTypeResolver` is deprecated and will be removed in a future release.
122+
130123
## [Contributing](CONTRIBUTING.md)
131124

132125
## More on OpenApi & Swagger

0 commit comments

Comments
 (0)