@@ -705,7 +705,33 @@ public function register(): void
705
705
/** @var ConfigRepository */
706
706
$ config = $ app ['config ' ];
707
707
708
- return new Options (title: $ config ->get ('api-platform.title ' ) ?? '' );
708
+ return new Options (
709
+ title: $ config ->get ('api-platform.title ' , '' ),
710
+ description: $ config ->get ('api-platform.description ' , '' ),
711
+ version: $ config ->get ('api-platform.version ' , '' ),
712
+ oAuthEnabled: $ config ->get ('api-platform.swagger_ui.oauth.enabled ' , false ),
713
+ oAuthType: $ config ->get ('api-platform.swagger_ui.oauth.type ' , null ),
714
+ oAuthFlow: $ config ->get ('api-platform.swagger_ui.oauth.flow ' , null ),
715
+ oAuthTokenUrl: $ config ->get ('api-platform.swagger_ui.oauth.tokenUrl ' , null ),
716
+ oAuthAuthorizationUrl: $ config ->get ('api-platform.swagger_ui.oauth.authorizationUrl ' , null ),
717
+ oAuthRefreshUrl: $ config ->get ('api-platform.swagger_ui.oauth.refreshUrl ' , null ),
718
+ oAuthScopes: $ config ->get ('api-platform.swagger_ui.oauth.scopes ' , []),
719
+ apiKeys: $ config ->get ('api-platform.swagger_ui.apiKeys ' , []),
720
+ );
721
+ });
722
+
723
+ $ this ->app ->singleton (SwaggerUiProcessor::class, function (Application $ app ) {
724
+ /** @var ConfigRepository */
725
+ $ config = $ app ['config ' ];
726
+
727
+ return new SwaggerUiProcessor (
728
+ urlGenerator: $ app ->make (UrlGeneratorInterface::class),
729
+ normalizer: $ app ->make (NormalizerInterface::class),
730
+ openApiOptions: $ app ->make (Options::class),
731
+ oauthClientId: $ config ->get ('api-platform.swagger_ui.oauth.clientId ' ),
732
+ oauthClientSecret: $ config ->get ('api-platform.swagger_ui.oauth.clientSecret ' ),
733
+ oauthPkce: $ config ->get ('api-platform.swagger_ui.oauth.pkce ' , false ),
734
+ );
709
735
});
710
736
711
737
$ this ->app ->singleton (DocumentationController::class, function (Application $ app ) {
0 commit comments