diff --git a/chord_metadata_service/phenopackets/serializers.py b/chord_metadata_service/phenopackets/serializers.py index b1099ab4d..868f44d89 100644 --- a/chord_metadata_service/phenopackets/serializers.py +++ b/chord_metadata_service/phenopackets/serializers.py @@ -159,8 +159,9 @@ def to_representation(self, instance): response["variant_interpretation"] = VariantInterpretationSerializer( instance.variant_interpretation, many=False, required=False).data - # subject_or_biosample_id is obtained from the referenced subject/biosample - # the referenced object type is added to extra_properties to disambiguate on the client side + # The 'subject_or_biosample_id' value is obtained from the referenced subject/biosample + # The '__related_type' property is added to extra_properties as a computed value ("__" prefix) + # This allows us to disambiguate on the client side for links extra_properties = response.get("extra_properties", {}) if instance.subject: response["subject_or_biosample_id"] = instance.subject.id