File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
localstack-core/localstack/http/resources/swagger Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
3
3
from jinja2 import Environment , FileSystemLoader
4
- from rolo import route
4
+ from rolo import Request , route
5
5
6
6
from localstack .config import external_service_url
7
7
from localstack .http import Response
8
8
9
9
10
10
class SwaggerUIApi :
11
- init_path : str
12
-
13
- def __init__ (self ) -> None :
14
- self .init_path = f"{ external_service_url ()} /openapi.yaml"
15
-
16
11
@route ("/_localstack/swagger" , methods = ["GET" ])
17
- def server_swagger_ui (self , _request ):
12
+ def server_swagger_ui (self , request : Request ) -> Response :
13
+ init_path = f"{ external_service_url (protocol = request .scheme )} /openapi.yaml"
18
14
oas_path = os .path .join (os .path .dirname (__file__ ), "templates" )
19
15
env = Environment (loader = FileSystemLoader (oas_path ))
20
16
template = env .get_template ("index.html" )
21
- rendered_template = template .render (swagger_url = self . init_path )
17
+ rendered_template = template .render (swagger_url = init_path )
22
18
return Response (rendered_template , content_type = "text/html" )
You can’t perform that action at this time.
0 commit comments