@@ -62,21 +62,18 @@ def addSwagger(apiInstance, appInstance):
6262 documentationUrl ,
6363 DOCUMENTATION_FILE
6464 )
65- selfSrcPath = f"""src{ globals .OS_SEPARATOR } service{ globals .OS_SEPARATOR } openapi{ globals .OS_SEPARATOR } { __name__ .split ('.' )[- 1 ]} .py"""
66- log .debug (addSwagger , f'selfSrcPath at "{ selfSrcPath } "' )
67-
68- # apiInstance.documentationFolderPath = f'''{__file__.split(selfSrcPath)[0]}{KW_RESOURCE}{globals.OS_SEPARATOR}{KW_OPEN_API}{KW_UI}'''
65+ # selfSrcPath = f"""src{globals.OS_SEPARATOR}service{globals.OS_SEPARATOR}openapi{globals.OS_SEPARATOR}{__name__.split('.')[-1]}.py"""
66+ # log.debug(addSwagger, f'selfSrcPath at "{selfSrcPath}"')
67+ #
68+ # apiInstance.documentationFolderPath = f'''{__file__.split(selfSrcPath)[0]}{KW_RESOURCE}{globals.OS_SEPARATOR}{KW_OPEN_API}{KW_UI}{globals.OS_SEPARATOR} '''
6969 # log.debug(addSwagger, f'apiInstance.documentationFolderPath at "{apiInstance.documentationFolderPath}"')
70+ #
71+ # swaggerUi._static_folder = apiInstance.documentationFolderPath
72+ # log.debug(addSwagger, f'swaggerUi._static_folder at "{swaggerUi._static_folder}"')
7073
71- apiInstance .documentationFolderPath = f''' { __file__ . split ( selfSrcPath )[ 0 ] } { KW_RESOURCE } { globals . OS_SEPARATOR } { KW_OPEN_API } { KW_UI } { globals . OS_SEPARATOR } '''
74+ apiInstance .documentationFolderPath = swaggerUi . _static_folder
7275 log .debug (addSwagger , f'apiInstance.documentationFolderPath at "{ apiInstance .documentationFolderPath } "' )
7376
74- swaggerUi ._static_folder = apiInstance .documentationFolderPath
75- log .debug (addSwagger , f'swaggerUi._static_folder at "{ swaggerUi ._static_folder } "' )
76-
77- # apiInstance.documentationFolderPath = swaggerUi._static_folder
78- # log.debug(addSwagger, f'apiInstance.documentationFolderPath at "{apiInstance.documentationFolderPath}"')
79-
8077 appInstance .register_blueprint (swaggerUi , url_prefix = documentationUrl )
8178 OpenApiDocumentationFile .overrideDocumentation (apiInstance )
8279
0 commit comments