Skip to content

Commit

Permalink
update to TRAPi 1.5.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
edeutsch committed Apr 17, 2024
1 parent 11fb192 commit 422be59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/ARAX/ResponseCache/response_cache.py
Expand Up @@ -45,8 +45,8 @@ def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../UI/OpenAPI/python-flask-server/")
from openapi_server.models.response import Response as Envelope

trapi_version = '1.4.2'
biolink_version = '3.5.4'
trapi_version = '1.5.0-beta'
biolink_version = '4.1.6'


def validate_envelope(process_params):
Expand Down Expand Up @@ -398,9 +398,11 @@ def get_response(self, response_id):
enable_validation = True
schema_version = trapi_version
if enable_validation:
#if True:
try:

#### Perform the validation
eprint(f"Validating TRAPI with version {schema_version} and {biolink_version}")
validator = TRAPIResponseValidator(trapi_version=schema_version, biolink_version=biolink_version)
validator.check_compliance_of_trapi_response(envelope)
validation_messages_text = validator.dumps()
Expand All @@ -419,6 +421,7 @@ def get_response(self, response_id):
else:
envelope['validation_result'] = { 'status': 'PASS', 'version': schema_version, 'message': '', 'validation_messages': messages, 'validation_messages_text': validation_messages_text }

#else:
except Exception as error:
timestamp = str(datetime.now().isoformat())
if 'logs' not in envelope or envelope['logs'] is None:
Expand Down

0 comments on commit 422be59

Please sign in to comment.