@@ -63,27 +63,25 @@ def bootstrap_before(self) -> dict[str, typing.Any]:
6363 ),
6464 )
6565 if self .instrument_config .swagger_offline_docs
66- else ()
66+ else (SwaggerRenderPlugin (), )
6767 )
6868
69- openapi_config : typing .Final = openapi .OpenAPIConfig (
70- path = self .instrument_config .swagger_path ,
71- title = self .instrument_config .service_name ,
72- version = self .instrument_config .service_version ,
73- description = self .instrument_config .service_description ,
74- render_plugins = render_plugins ,
75- ** self .instrument_config .swagger_extra_params ,
76- )
69+ all_swagger_params : typing .Final = {
70+ "path" : self .instrument_config .swagger_path ,
71+ "title" : self .instrument_config .service_name ,
72+ "version" : self .instrument_config .service_version ,
73+ "description" : self .instrument_config .service_description ,
74+ "render_plugins" : render_plugins ,
75+ } | self .instrument_config .swagger_extra_params
7776
78- bootstrap_result : typing .Final = {}
77+ bootstrap_result : typing .Final [dict [str , typing .Any ]] = {
78+ "openapi_config" : openapi .OpenAPIConfig (** all_swagger_params )
79+ }
7980 if self .instrument_config .swagger_offline_docs :
8081 bootstrap_result ["static_files_config" ] = [
8182 generate_static_files_config (static_files_handler_path = self .instrument_config .service_static_path ),
8283 ]
83- return {
84- ** bootstrap_result ,
85- "openapi_config" : openapi_config ,
86- }
84+ return bootstrap_result
8785
8886
8987@LitestarBootstrapper .use_instrument ()
0 commit comments