Skip to content

Commit 436ba3c

Browse files
authored
Add installation details for radebatz/type-info-extras (#1821)
1 parent c19ec55 commit 436ba3c

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ 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 that is 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+
4763
### doctrine/annotations
4864
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**.
4965

docs/guide/installation.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,33 @@ Alternatively, use the composer `global` argument to install `swagger-php` globa
1818
::: warning PATH variables
1919
Remember to add the `~/.composer/vendor/bin` directory to the PATH in your environment.
2020
:::
21+
22+
## Type resolvers
23+
24+
`swagger-php` version `5.5` introduces a new type resolver that is used internally to determine the schema type
25+
of properties (and other elements with a schema).
26+
27+
By default, a custom `LegacyTypeResolver` is used. If you are on PHP 8.2 or higher,
28+
the `TypeInfoTypeResolver` can be used instead.
29+
For this the [radebatz/type-info-extras](https://github.com/DerManoMann/type-info-extras) package is required.
30+
31+
Since it is optional, it needs to be installed manually:
32+
33+
```shell
34+
composer require radebatz/type-info-extras
35+
```
36+
37+
::: warning Additional dependencies
38+
Installing `radebatz/type-info-extras` will also add `symfony/type-info` as a dependency.
39+
:::
40+
41+
42+
## Using doctrine annotations
43+
44+
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**.
45+
46+
If your code uses doctrine annotations you will need to install that library manually:
47+
48+
```shell
49+
composer require doctrine/annotations
50+
```

0 commit comments

Comments
 (0)