Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions synapseclient/extensions/curator/schema_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5198,7 +5198,10 @@ def _convert_conditional_properties_to_all_of(
"Cancer"
]
}
}
},
"required":[
"Diagnosis"
]
},
"then":{
"properties":{
Expand All @@ -5217,7 +5220,10 @@ def _convert_conditional_properties_to_all_of(
enum_value,
), dependent_properties in conditional_dependencies.items():
conditional_dep = {
"if": {"properties": {watched_property: {"enum": [enum_value]}}},
"if": {
"properties": {watched_property: {"enum": [enum_value]}},
"required": [watched_property],
},
"then": {
"properties": {
prop: {"not": {"type": "null"}} for prop in dependent_properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"BAM"
]
}
}
},
"required":[
"File Format"
]
},
"then": {
"properties": {
Expand All @@ -33,7 +36,10 @@
"CRAM"
]
}
}
},
"required":[
"File Format"
]
},
"then": {
"properties": {
Expand Down Expand Up @@ -62,7 +68,10 @@
"CSV/TSV"
]
}
}
},
"required":[
"File Format"
]
},
"then": {
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"BAM"
]
}
}
},
"required":[
"FileFormat"
]
},
"then": {
"properties": {
Expand All @@ -33,7 +36,10 @@
"CRAM"
]
}
}
},
"required":[
"FileFormat"
]
},
"then": {
"properties": {
Expand Down Expand Up @@ -62,7 +68,10 @@
"CSV/TSV"
]
}
}
},
"required":[
"FileFormat"
]
},
"then": {
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"Cancer"
]
}
}
},
"required":[
"Diagnosis"
]
},
"then": {
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"Cancer"
]
}
}
},
"required":[
"Diagnosis"
]
},
"then": {
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ def test_convert_conditional_properties_to_all_of(self) -> None:

# THEN the result should match the expected structure
expected_cancer = {
"if": {"properties": {"Diagnosis": {"enum": ["Cancer"]}}},
"if": {
"properties": {"Diagnosis": {"enum": ["Cancer"]}},
"required": ["Diagnosis"],
},
"then": {
"properties": {
"CancerType": {"not": {"type": "null"}},
Expand All @@ -338,7 +341,10 @@ def test_convert_conditional_properties_to_all_of(self) -> None:
}

expected_healthy = {
"if": {"properties": {"Diagnosis": {"enum": ["Healthy"]}}},
"if": {
"properties": {"Diagnosis": {"enum": ["Healthy"]}},
"required": ["Diagnosis"],
},
"then": {
"properties": {"CheckupDate": {"not": {"type": "null"}}},
"required": ["CheckupDate"],
Expand Down
Loading