File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ def setup_swagger(app: web.Application,
5050 _swagger_url = ("/{}" .format (swagger_url )
5151 if not swagger_url .startswith ("/" )
5252 else swagger_url )
53- _swagger_def_url = '{}/swagger.json' .format (_swagger_url )
53+ _base_swagger_url = _swagger_url .rstrip ('/' )
54+ _swagger_def_url = '{}/swagger.json' .format (_base_swagger_url )
5455
5556 # Build Swagget Info
5657 if swagger_info is None :
@@ -75,11 +76,12 @@ def setup_swagger(app: web.Application,
7576
7677 # Add API routes
7778 app .router .add_route ('GET' , _swagger_url , _swagger_home_func )
78- app .router .add_route ('GET' , "{}/" .format (_swagger_url ), _swagger_home_func )
79+ app .router .add_route ('GET' , "{}/" .format (_base_swagger_url ),
80+ _swagger_home_func )
7981 app .router .add_route ('GET' , _swagger_def_url , _swagger_def_func )
8082
8183 # Set statics
82- statics_path = '{}/swagger_static' .format (_swagger_url )
84+ statics_path = '{}/swagger_static' .format (_base_swagger_url )
8385 app .router .add_static (statics_path , STATIC_PATH )
8486
8587 # --------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments