diff --git a/CHANGELOG.md b/CHANGELOG.md index 58cafe9..0869480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ The Reasoner Validator package is evolving along with progress in TRAPI and Biolink Model standards within the NCATS Biomedical Knowledge Translator. +## v3.5.10 +- Extend TRAPI Response sanitization (following Eric Deutsch guidance) + ## v3.5.9 - Fixed bug in attribute_type_id detection of attribute_type_id namespaces diff --git a/pyproject.toml b/pyproject.toml index 173cf3c..bfe6e8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reasoner-validator" -version = "3.5.9" +version = "3.5.10" description = "Validation tools for Reasoner API" authors = [ "Richard Bruskiewich ", diff --git a/reasoner_validator/__init__.py b/reasoner_validator/__init__.py index dc0f592..e2f23f6 100644 --- a/reasoner_validator/__init__.py +++ b/reasoner_validator/__init__.py @@ -31,6 +31,7 @@ class TRAPIResponseValidator(ValidationReporter): TRAPI_1_3_0 = SemVer.from_string("1.3.0") TRAPI_1_4_0 = SemVer.from_string("1.4.0") + TRAPI_1_4_0_BETA3 = SemVer.from_string("1.4.0-beta3") TRAPI_1_4_0_BETA4 = SemVer.from_string("1.4.0-beta4") def __init__( @@ -90,8 +91,10 @@ def sanitize_trapi_response(self, response: Dict) -> Dict: if 'upstream_resource_ids' not in source or source['upstream_resource_ids'] is None: source['upstream_resource_ids'] = [] - # 'auxiliary_graphs' ought to be nullable, however... not specified that way (yet) - if 'auxiliary_graphs' not in response['message'] or response['message']['auxiliary_graphs'] is None: + # 'auxiliary_graphs' (from TRAPI 1.4.0-beta2 onwards) + # ought to be nullable, however... not specified that way (yet) + if current_version >= self.TRAPI_1_4_0_BETA3 and \ + ('auxiliary_graphs' not in response['message'] or response['message']['auxiliary_graphs'] is None): response['message']['auxiliary_graphs'] = [] if 'workflow' in response and response['workflow']: