Skip to content

feat(laravel): swagger_ui.extra_configuration option - #8890

Merged
soyuka merged 3 commits into
api-platform:mainfrom
ViPErCZ:feat/laravel-swagger-ui-extra-configuration
Dec 3, 2026
Merged

soyuka merged 3 commits into
api-platform:mainfrom
ViPErCZ:feat/laravel-swagger-ui-extra-configuration

Conversation

@ViPErCZ

@ViPErCZ ViPErCZ commented Nov 27, 2026

Copy link
Copy Markdown
Contributor
Q A
Branch? main
Tickets Follow-up of #8538
New feature? yes
Deprecations? no
License MIT

First part of the split of #8538.

The Laravel init-swagger-ui.js already does Object.assign(config, data.extraConfiguration), but SwaggerUiProcessor never passed that key, so there was no way to tune Swagger UI from
the Laravel configuration. The Symfony bundle has swagger_ui_extra_configuration for this, and Laravel already has scalar.extra_configuration.

This adds the matching option:

// config/api-platform.php
'swagger_ui' => [
    'enabled' => true,
    'extra_configuration' => [
        'docExpansion' => 'list',
        'filter' => true,
    ],
],

The new constructor argument of SwaggerUiProcessor is added last with a default value, so there is no BC break.

Note: persistAuthorization, which I mentioned in #8538, is already exposed on main, so it is not part of this PR.

never exposed it. Add the "api-platform.swagger_ui.extra_configuration"
option, mirroring "swagger_ui_extra_configuration" of the Symfony bundle
and the existing "scalar.extra_configuration".
@soyuka
soyuka merged commit 4c95cfe into api-platform:main Dec 3, 2026
91 of 116 checks passed
@soyuka

soyuka commented Dec 3, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants