Skip to content

fix(Console): support symfony/console 5.4 and up - #2197

Open
garak wants to merge 1 commit into
zircote:masterfrom
garak:fix-sf-reqs
Open

fix(Console): support symfony/console 5.4 and up#2197
garak wants to merge 1 commit into
zircote:masterfrom
garak:fix-sf-reqs

Conversation

@garak

@garak garak commented Sep 13, 2026

Copy link
Copy Markdown

Overview

The symfony/console requirement of ^7.4 kept swagger-php off Symfony 6.4 LTS, which is supported until November 2027. The console component is only used by the CLI, and the requirement came from the command layer using the input-mapping attributes that only exist as of 7.4.

The CLI surface is unchanged: openapi -h reports the same arguments and options, and --version still sets the OpenAPI version rather than printing the tool
version.

Closes #2180.

Changes

  • symfony/console is accepted from 5.4 (generally, the symfony/* constraints are now consistent)
  • GenerateCommand is a Command subclass again, defining its input in configure() and running in execute().
  • GenerateInput is a plain DTO, hydrated by GenerateInput::fromInput(), which also validates --format and --mode.
  • bin/openapi registers the command through whichever of Application::addCommand() and Application::add() the installed console offers, and its ArgvInput subclass no longer types hasParameterOption().
  • DocsAccuracyTest compares the command's own help only; the built-in options below --help differ per console version.

GenerateCommand extends Command again, with configure() and execute();
GenerateInput is a plain DTO, hydrated by GenerateInput::fromInput() and
validating --format and --mode itself. bin/openapi calls
Application::addCommand() where it exists and add() otherwise, and its
ArgvInput subclass leaves hasParameterOption() untyped, as 5.4 declares no
parameter type there.

DocsAccuracyTest compares only the command's own help; the built-in options
below --help differ per console version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

symfony/console ^7.4 requirement locks the library out of Symfony 6.4 LTS, though only the CLI needs it

1 participant