File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 4242 'router.swagger.css_urls ' => SwaggerConfiguration::DEFAULT_CSS_URLS ,
4343 'router.swagger.js_urls ' => SwaggerConfiguration::DEFAULT_JS_URLS ,
4444 'router.swagger.openapi_uri ' => SwaggerConfiguration::DEFAULT_OPENAPI_URI ,
45+ 'router.swagger.template_variables ' => [],
4546
4647 OpenApiConfiguration::class => create ()
4748 ->constructor (
8283 cssUrls: get ('router.swagger.css_urls ' ),
8384 jsUrls: get ('router.swagger.js_urls ' ),
8485 openapiUri: get ('router.swagger.openapi_uri ' ),
86+ templateVariables: get ('router.swagger.template_variables ' ),
8587 ),
8688];
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
5656 TemplateRenderer::renderTemplate (
5757 filename: $ this ->swaggerConfiguration ->templateFilename ,
5858 variables: [
59+ ...$ this ->swaggerConfiguration ->templateVariables ,
5960 self ::CSS_URLS_VAR_NAME => $ this ->swaggerConfiguration ->cssUrls ,
6061 self ::JS_URLS_VAR_NAME => $ this ->swaggerConfiguration ->jsUrls ,
6162 self ::OPENAPI_URI_VAR_NAME => $ this ->swaggerConfiguration ->openapiUri ,
Original file line number Diff line number Diff line change @@ -35,11 +35,13 @@ final class SwaggerConfiguration
3535
3636 public function __construct (
3737 public readonly string $ templateFilename = self ::DEFAULT_TEMPLATE_FILENAME ,
38- /** @var string[] */
38+ /** @var array<array-key, string> */
3939 public readonly array $ cssUrls = self ::DEFAULT_CSS_URLS ,
40- /** @var string[] */
40+ /** @var array<array-key, string> */
4141 public readonly array $ jsUrls = self ::DEFAULT_JS_URLS ,
4242 public readonly string $ openapiUri = self ::DEFAULT_OPENAPI_URI ,
43+ /** @var array<string, mixed> */
44+ public readonly array $ templateVariables = [],
4345 ) {
4446 }
4547}
You can’t perform that action at this time.
0 commit comments