fix OpenAPI JSON file rendering (#775)

This commit is contained in:
Tom Kralidis
2021-09-13 14:26:05 -04:00
parent 0d3c0b5ee9
commit 652ecfedf7
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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_))