Skip to content

Commit

Permalink
[FIX] configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ViPErCZ committed Dec 18, 2024
1 parent f6b891b commit 2d29324
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Laravel/public/init-swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ window.onload = function() {
spec: data.spec,
dom_id: '#swagger-ui',
validatorUrl: null,
persistAuthorization: data.persistAuthorization,
oauth2RedirectUrl: data.oauth.redirectUrl,
presets: [
SwaggerUIBundle.presets.apis,
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->booleanNode('handle_symfony_errors')->defaultFalse()->info('Allows to handle symfony exceptions.')->end()
->booleanNode('enable_swagger')->defaultTrue()->info('Enable the Swagger documentation and export.')->end()
->booleanNode('enable_swagger_ui')->defaultValue(class_exists(TwigBundle::class))->info('Enable Swagger UI')
->booleanNode('persistAuthorization')->defaultValue(false)->info('Enable Swagger UI Persist Authorization')->end()
->end()
->booleanNode('enable_swagger_ui')->defaultValue(class_exists(TwigBundle::class))->info('Enable Swagger UI')->end()
->booleanNode('enable_re_doc')->defaultValue(class_exists(TwigBundle::class))->info('Enable ReDoc')->end()
->booleanNode('enable_entrypoint')->defaultTrue()->info('Enable the entrypoint')->end()
->booleanNode('enable_docs')->defaultTrue()->info('Enable the docs')->end()
Expand Down Expand Up @@ -291,6 +289,7 @@ private function addSwaggerSection(ArrayNodeDefinition $rootNode): void
->arrayNode('swagger')
->addDefaultsIfNotSet()
->children()
->booleanNode('persistAuthorization')->defaultValue(false)->info('Enable Swagger UI Persist Authorization')->end()
->arrayNode('versions')
->info('The active versions of OpenAPI to be exported or used in Swagger UI. The first value is the default.')
->defaultValue($supportedVersions)
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/Resources/config/openapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<argument>%api_platform.openapi.license.name%</argument>
<argument>%api_platform.openapi.license.url%</argument>
<argument>%api_platform.openapi.overrideResponses%</argument>
<argument>%api_platform.swagger_ui.overrideResponses%</argument>
</service>
<service id="ApiPlatform\OpenApi\Options" alias="api_platform.openapi.options" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private function runDefaultConfigTests(array $doctrineIntegrationsToLoad = ['orm
'versions' => [3],
'api_keys' => [],
'swagger_ui_extra_configuration' => [],
'persistAuthorization' => false,
],
'eager_loading' => [
'enabled' => true,
Expand Down

0 comments on commit 2d29324

Please sign in to comment.