Skip to content
Merged
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
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ For cli usage from anywhere, install swagger-php globally and make sure to place
composer global require zircote/swagger-php
```

### radebatz/type-info-extras
`swagger-php` version `5.5` introduces a new type resolver used internally to determine the schema type
of properties (and other elements with a schema).

By default, a custom `LegacyTypeResolver` is used. If you are on PHP 8.2 or higher,
the `TypeInfoTypeResolver` can be used instead.
For this the [radebatz/type-info-extras](https://github.com/DerManoMann/type-info-extras) package is required.
Since it is optional, it needs to be installed manually. It will also add `symfony/type-info` as a dependency:

```shell
composer require radebatz/type-info-extras
```

If the library code is detected, `swagger-php` will automatically use it.
Advantages are re-use of 3rd party code, better stability and compatibility with future PHP versions.

### doctrine/annotations
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**.

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

## The `LegacyTypeResolver`

As of version 6, resolution of types is done using the `TypeInfoTypeResolver` class. It uses the `symfony/type-info`
library under the hood which improves handling of complext types.

If this is not desired, the `LegacyTypeResolver` can be used to preserve the old behaviour of version 5.

The `LegacyTypeResolver` is deprecated and will be removed in a future release.

## [Contributing](CONTRIBUTING.md)

## More on OpenApi & Swagger
Expand Down