Skip to content

Generate the fallback specification with swagger-php's Builder - #88

Merged
DerManoMann merged 2 commits into
mainfrom
fix/builder-fallback
Oct 14, 2026
Merged

DerManoMann merged 2 commits into
mainfrom
fix/builder-fallback

Conversation

@DerManoMann

Copy link
Copy Markdown
Owner

When no specification is given or found, the Laravel and Slim adapters generate one from source. That used Generator, which swagger-php 7 deprecates, and ended in an Error when swagger-php is not installed.

The generation moves into a protected generateOpenApiSpecification(). It uses Builder where available, Generator before swagger-php 6.4, and otherwise throws a LogicException naming the files looked for and the package to install.

The mode is left at swagger-php's default. Forcing hybrid would switch 6.x output from 3.0.0 to 3.1.0 and change how nullable is verified. A project written in OpenApi\Spec attributes on 6.x can override the method with Mode::SPEC.

@DerManoMann
DerManoMann merged commit a74ce51 into main Oct 14, 2026
20 of 21 checks passed
@DerManoMann
DerManoMann deleted the fix/builder-fallback branch October 14, 2026 03:00
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.

1 participant