Skip to content

Commit

Permalink
Don't write to openapi.yaml when generate_swagger set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkyffin committed Feb 26, 2021
1 parent 856c31e commit 611c227
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datagateway_api/src/api_start_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def openapi_config(spec):
for endpoint_name in sorted(entity_data.keys()):
entity_data.move_to_end(endpoint_name)

openapi_spec_path = Path(__file__).parent / "swagger/openapi.yaml"
with open(openapi_spec_path, "w") as f:
f.write(spec.to_yaml())
openapi_spec_path = Path(__file__).parent / "swagger/openapi.yaml"
with open(openapi_spec_path, "w") as f:
f.write(spec.to_yaml())


def create_openapi_endpoint(app, api_spec):
Expand Down

0 comments on commit 611c227

Please sign in to comment.