Skip to content

Commit

Permalink
making prefix optional for openapi servers block construction, before…
Browse files Browse the repository at this point in the history
… nothing would get generated if a prefix like "1.4" wasn't provided
  • Loading branch information
EvanDietzMorris committed Apr 23, 2024
1 parent 6c6752d commit 9ddc859
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PLATER/services/util/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def construct_open_api_schema(app, trapi_version, prefix="", plater_title='Plate
if x_translator_extension:
# if x_translator_team is defined amends schema with x_translator extension
open_api_schema["info"]["x-translator"] = x_translator_extension
open_api_schema["info"]["x-translator"]["biolink-version"] = config.get("BL_VERSION", "2.1.0")
open_api_schema["info"]["x-translator"]["biolink-version"] = config.get("BL_VERSION", "4.1.6")
open_api_schema["info"]["x-translator"]["infores"] = config.get('PROVENANCE_TAG', 'infores:automat.notspecified')

if contact_config:
Expand All @@ -70,13 +70,13 @@ def construct_open_api_schema(app, trapi_version, prefix="", plater_title='Plate

if servers_conf:
for cnf in servers_conf:
if prefix and 'url' in cnf:
if 'url' in cnf:
cnf['url'] = cnf['url'] + prefix
cnf['x-maturity'] = os.environ.get("MATURITY_VALUE", "maturity")
cnf['x-location'] = os.environ.get("LOCATION_VALUE", "location")
cnf['x-trapi'] = trapi_version
cnf['x-translator'] = {}
cnf['x-translator']['biolink-version'] = config.get("BL_VERSION", "2.1.0")
cnf['x-translator']['biolink-version'] = config.get("BL_VERSION", "4.1.6")
cnf['x-translator']['test-data-location'] = server_url.strip('/') + "/sri_testing_data"
open_api_schema["servers"] = servers_conf

Expand Down

0 comments on commit 9ddc859

Please sign in to comment.