Repository navigation
Description
Continuing from #1953, which covered v6 and v7.
Since 7.0, hybrid is the default mode: existing OpenApi\Attributes and annotations are scanned as before, and the output goes through the spec pipeline. Classic is deprecated and removed in 8.0. The plan itself is in ROADMAP.md, and the modes are described at Processing modes.
7.x
7.x minors add to the spec pipeline and fix what hybrid turns up in real codebases. They do not remove anything. A deprecation names the version that removes it, and that is 8.0 throughout 7.x.
Some minors change the generated document, for example a fix that writes a field classic left out. Each of those is listed under "Changed output in 7.x" in Migrating to v7, with the version.
Shipped so far:
- a replaceable namer for component names (7.1)
- plugins, and finding them through Composer (7.3, 7.6)
- build messages with consistent levels and wording (7.5)
- all of OpenAPI 3.2 in the spec attributes, and a warning wherever a field cannot be written for the target version (7.7, 7.8)
- performance: spec mode no longer parses PHP files (7.6)
Still open in 7.x:
- more performance work, measured against real codebases
- what framework integrations report as missing (see below)
v8 - classic removed
- the classic pipeline,
OpenApi\Annotations, docblock annotation support and theGeneratorare removed -
Builder::setMode()and mode selection are removed, since there is only one pipeline left - the spec attributes move from
OpenApi\SpectoOpenApi\Attributes. For code written againstOpenApi\Specthat is oneuseline per file, and the rector set does it -
TokenScannerand thenikic/php-parserdependency go with classic - parameters added to spec attributes in 7.x move to their place before
x,attachablesandfan - a v8 migration guide, leading with the one trap: if you are still on the classic
OpenApi\Attributes, the class names stay but the constructors differ, so you get unknown named parameter errors rather than missing classes. The rector set is the fix
Open: whether OpenApi\Spec stays as deprecated aliases for one major, so the move is optional until v9.
Preparing for 8.0 has the details known today.
What this means for you
You use OpenApi\Attributes or annotations in your own code. Nothing to do for 7.x. Before v8 you will need the spec attributes, and the rector set rewrites OpenApi\Attributes to them. Docblock annotations are not covered by it; move them to attributes first.
You maintain a package wrapping swagger-php. Hybrid keeps you working through 7.x. Extension points and plugins are the hooks. If something is missing for your package, please comment here or open an issue.
You build documents in code. Spec attributes are value objects, and the compiler turns them into an array for any of 3.0, 3.1 and 3.2. Why spec? starts with that.
Activity