fix OpenAPI JSON file rendering (#775)
This commit is contained in:
+1
-1
@@ -690,7 +690,7 @@ class API:
|
||||
if isinstance(openapi, dict):
|
||||
return headers, 200, to_json(openapi, self.pretty_print)
|
||||
else:
|
||||
return headers, 200, openapi.read()
|
||||
return headers, 200, openapi
|
||||
|
||||
@pre_process
|
||||
def conformance(self,
|
||||
|
||||
@@ -134,8 +134,8 @@ def openapi():
|
||||
with open(os.environ.get('PYGEOAPI_OPENAPI'), encoding='utf8') as ff:
|
||||
if os.environ.get('PYGEOAPI_OPENAPI').endswith(('.yaml', '.yml')):
|
||||
openapi_ = yaml_load(ff)
|
||||
else: # JSON file, do not transform
|
||||
openapi_ = ff
|
||||
else: # JSON string, do not transform
|
||||
openapi_ = ff.read()
|
||||
|
||||
return get_response(api_.openapi(request, openapi_))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user