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,
50
50
_swagger_url = ("/{}" .format (swagger_url )
51
51
if not swagger_url .startswith ("/" )
52
52
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 )
54
55
55
56
# Build Swagget Info
56
57
if swagger_info is None :
@@ -75,11 +76,12 @@ def setup_swagger(app: web.Application,
75
76
76
77
# Add API routes
77
78
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 )
79
81
app .router .add_route ('GET' , _swagger_def_url , _swagger_def_func )
80
82
81
83
# Set statics
82
- statics_path = '{}/swagger_static' .format (_swagger_url )
84
+ statics_path = '{}/swagger_static' .format (_base_swagger_url )
83
85
app .router .add_static (statics_path , STATIC_PATH )
84
86
85
87
# --------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments