phenopackets / phenopacket-tools

An app and library for building, conversion, and validation of GA4GH Phenopackets.
http://phenopackets.org/phenopacket-tools/stable/
GNU General Public License v3.0
10 stars 5 forks source link

Empty `onset` field in `diseases` #186

Closed yaseminbridges closed 1 year ago

yaseminbridges commented 1 year ago

Hi,

I am using the latest code (RC4) and when running the conversion for a v1 phenopacket to v2 the disease field appears to create an empty field for the onset:

  "diseases": [
    {
      "term": {
        "id": "OMIM:120435",
        "label": "LYNCH SYNDROME I"
      },
      "onset": {}
    }
  ],

Looking at the previous outputs from older RC versions this didn't happen, so appears to be a recent bug.

ielis commented 1 year ago

Hi, thanks for reporting the issue. I would not call this a bug, but it is definitely an unwanted subtlety. It was caused by the conversion code setting a protobuf default instance when a field was originally unset. In result, the serializer wrote an empty object field where it should not be written.

I fixed the conversion code in #187 and the updated code is available on develop branch.

Cheers, Daniel