Repository navigation
7.6 adds a parser for OpenAPI 3.1 documents. With it, Builder::withDocument() adds a hand-written document to what the attributes describe, for example webhooks with no PHP code behind them. Plugins can now also be found through the packages installed, and a spec build no longer parses PHP files.
Two changes affect the generated document or the log. Changed output in 7.6 has the details.
Changed output
- Classic and hybrid: a trait imported through a grouped
usenow adds its properties. Before, they were missing, with a warning. Thanks @vencakrecl (#2392) - Spec and hybrid: validation messages from different checks come out mixed, since the checks now run in one pass (#2367)
New
OpenApi\Parserreads an OpenAPI 3.1 document into aSpecification, andBuilder::withDocument()adds one to a spec or hybrid build. Where both describe the same thing, the attributes win. Only 3.1 documents are supported (#2387, docs, cookbook)Builder::withDiscoveredPlugins()adds the plugins installed packages declare in their Composer metadata. It is opt-in (#2385, docs)Parameter,RequestBody,Response,Header,LinkandSecurity\Schemetake asummary, written beside a$reffrom 3.1 on (#2389)
Changed
AttributeFactorytakes anySourceInspectorInterface. The defaultSourceInspectortells a class's own members by reflection, so a spec build parses no PHP. A subclass reading$tokenScannergets the interface (#2373, #2374, docs)- A subclass declaring its own
$summaryon one of those six attributes needs it aspublic ?string $summary(#2389)
Deprecated
TokenScanner, removed in 8.0. UseSourceInspector(#2388)
Fixed
- A docblock the type resolver fails on is reported as unsupported, and the build carries on. Before, some ended the build (#2393)
composer.jsonno longer conflicts withsymfony/process, which swagger-php does not depend on (#2395)
Performance
- The validation checks share one walk:
validate()at 500 schemas went from 97 to 39 ms (#2367)
What's Changed
- refactor(Utils): ask a source inspector which members and traits are a class's own by @DerManoMann in #2373
- perf(Utils): tell a class's own members by reflection, without parsing by @DerManoMann in #2374
- chore(Config): keep the tool caches in .cache/ by @DerManoMann in #2378
- chore(deps-dev): update friendsofphp/php-cs-fixer requirement from 3.95.27 to 3.95.29 by @dependabot[bot] in #2381
- chore(deps-dev): update phpstan/phpstan requirement from 2.3.4 to 2.3.5 by @dependabot[bot] in #2382
- chore(deps-dev): bump @redocly/cli from 2.72.1 to 2.76.0 in the npm group across 1 directory by @dependabot[bot] in #2380
- refactor(Compiler): share one walk between the validation checks by @DerManoMann in #2367
- chore(Config): run the test suites with a 256M memory limit by @DerManoMann in #2390
- chore(Utils): drop the @internal tag on SourceInspector::tokens() by @DerManoMann in #2379
- feat(Spec): add a summary beside a $ref on every referenceable attribute by @DerManoMann in #2389
- fix(TokenScanner): resolve grouped class imports by @vencakrecl in #2392
- fix(Type): report any docblock the type resolver fails on by @DerManoMann in #2393
- chore(Utils): deprecate
TokenScannerby @DerManoMann in #2388 - chore(Augmenter): drop the docblocks on the aware setters by @DerManoMann in #2384
- feat(Builder): discover the plugins installed packages declare by @DerManoMann in #2385
- fix(Composer): drop the symfony/process conflict by @DerManoMann in #2395
- feat(Parser): read an OpenAPI 3.1 document into a
Specificationby @DerManoMann in #2387 - docs(Guide): changed output in 7.6 by @DerManoMann in #2397
New Contributors
- @vencakrecl made their first contribution in #2392
Full Changelog: 7.5.0...7.6.0