Closed reepoi closed 1 year ago
I think #127 undid the length two inheritance, but this is still needed. What happens if the chain is length 3? Would we have to add another condition to that rule? If that's the case, then we should rather have a development rule discouraging inheritance chains.
The filtering condition does not need to change if a length three inheritance is added because the condition needs to only check one level up the inheritance chain from the definition to determine if it is an OB element. All OB elements inherit directly from TaxonomyElement<type>
, so any definition at the end of an inheritance chain longer than one is not an OB element.
Closes #120.
The taxonomy checker has validation rules that apply only to OB elements, so these rules filter the taxonomy definitions to find the OB elements. Since the taxonomy checker resolves all
$ref
pointers before running the filters, this filter cannot check the$ref
pointer string for containingTaxonomyElement
. Instead, this filter decides that a definition is an OB element ifallOf
exists, andallOf[0].properties.Value
exists.This implementation crashes when
allOf[0].properties
does not exist, and this happens when there is a chain of inheritance of length two or more. #117 included the chain of inheritanceScope -> MeasScope -> IrradPlaneOfArrayMeas
wheresuperclass -> subclass
. HereIrradPlaneOfArrayMeas.allOf[0]
equalsMeasScope.allOf
which is an array soIrradPlaneOfArrayMeas.allOf[0].properties
does not exist. To avoid crashing in this case, the filter now checks thatallOf
exists,allOf[0].properties
exists, and finally thatallOf[0].properties.Value
exists.