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
13 stars 5 forks source link

Document mapping of snake_case to lowerCamelCase when validating json #40

Closed cmungall closed 2 years ago

cmungall commented 2 years ago

The protobuf schema uses snake_case:

time_at_last_encounter

however, when I run pfx-tools example, the json examples using lowerCamelCase

E.g.

  "subject": {
    "id": "proband C",
    "timeAtLastEncounter": {
      "age": {
        "iso8601duration": "P27Y"
      }
    },

At first I thought this was a bug, but I see it is documented (albeit in the most cursory fashion) in the protobuf docs:

https://developers.google.com/protocol-buffers/docs/proto3#json

I suspect this is highly non-obvious to non-proto-geeks

maybe document here: https://phenopacket-schema.readthedocs.io/en/latest/java.html?highlight=json#json-export

I think this needs to be added to the phenopacket-schema, https://github.com/phenopackets/phenopacket-schema/issues/358

Also, we should add it to the manuscript. Closing here.

pnrobinson commented 2 years ago

I think this needs to be added to the phenopacket-schema, https://github.com/phenopackets/phenopacket-schema/issues/358

Also, we should add it to the manuscript. Closing here.