File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ function getGuideSidebar() {
2424 {
2525 text : 'Upgrading' ,
2626 items : [
27+ { text : 'Migration from 5.x to 6.x' , link : '/guide/migrating-to-v6' } ,
2728 { text : 'Migration from 4.x to 5.x' , link : '/guide/migrating-to-v5' } ,
2829 { text : 'Migration from 3.x to 4.x' , link : '/guide/migrating-to-v4' } ,
2930 { text : 'Migration from 2.x to 3.x' , link : '/guide/migrating-to-v3' } ,
Original file line number Diff line number Diff line change 22
33## Overview
44
5- v6 is mostly a cleanup release with updated dependencies. The main changes are:
5+ ` v6 ` is mostly a cleanup release, with updated dependencies. The main changes are:
66
7- * Minimum required PHP version is now 8.2
8- * ...
7+ * The minimum required PHP version is now 8.2
8+ * ` radebatz/type-info-extras ` is now a required dependency
9+ * ` TypeInfoTypeResolver ` now properly handles composite types (unions and intersections)
10+ * Some deprecations have been removed (see below)
11+ * The ` MediaType::encoding ` property now only accepts ` Encoding ` objects (BC break)
912
1013For most installations upgrading should not require any changes.
1114
15+ ## Type resolvers
16+ With ` radebatz/type-info-extras ` now being a required dependency, the ` TypeInfoTypeResolver ` is not the de-facto default
17+ resolver.
18+
19+ The ` LegacyTypeResolver ` can still be used as a drop-in replacement, but is now marked ` deprecated ` and will be removed
20+ in v7.
21+
1222## Removed deprecated elements
13- ### ` \Openapi\Generator::getProcessors() ` and ` \Openapi\Generator::setProcessors() `
23+ ### Methods ` \Openapi\Generator::getProcessors() ` and ` \Openapi\Generator::setProcessors() `
1424Use ` getProcessorPipeline() ` and ` setProcessorPipeline(new Pipeline(...)) ` methods instead
25+
26+ ### Static method ` \Openapi\Generator::scan() `
27+ Main entry point into the ` Generator ` is now the ** non-static** ` generate() ` method:
28+ ``` php
29+ (new Generator())->generate(/* ... */);
30+ ```
31+
32+ ### ` Utils ` helper
33+ Most methods in the class were internal to start with and the ` Util::finder() ` factory methods is now replaced with
34+ the new ` SourceFinder ` class.
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ public function jsonSerialize()
366366 if (isset ($ data ->type ) && is_array ($ data ->type )) {
367367 if (in_array ('null ' , $ data ->type )) {
368368 $ data ->nullable = true ;
369- $ data ->type = array_filter ($ data ->type , fn ($ t ): bool => ' null ' !== $ t );
369+ $ data ->type = array_filter ($ data ->type , fn ($ v ): bool => $ v !== ' null ' );
370370 if (1 === count ($ data ->type )) {
371371 $ data ->type = array_pop ($ data ->type );
372372 }
Original file line number Diff line number Diff line change 1111/**
1212 * Each Media Type object provides schema and examples for the media type identified by its key.
1313 *
14+ * Parameter encodings can be set either here, or on nested `Property` annotations directly.
15+ *
1416 * @see [Media Type Object](https://spec.openapis.org/oas/v3.1.1.html#media-type-object)
1517 *
1618 * @Annotation
Original file line number Diff line number Diff line change 1212use OpenApi \Generator ;
1313use OpenApi \TypeResolverInterface ;
1414
15+ /**
16+ * @deprecated use `TypeInfoTypeResolver` instead
17+ */
1518class LegacyTypeResolver extends AbstractTypeResolver
1619{
1720 /** @inheritdoc */
You can’t perform that action at this time.
0 commit comments