ga4gh / ga4gh/phenopacket-schema

Document mapping of snake_case to lowerCamelCase when validating json

Open
#358 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
101
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Document mapping of snake_case to lowerCamelCase when validating json

The protobuf schema uses snake_case:

[time_at_last_encounter](https://github.com/phenopackets/phenopacket-schema/blob/dd70d53b2c1dfd5ab6ac25b1b4b422b7be90a6ae/src/main/proto/phenopackets/schema/v2/core/individual.proto#L33)

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

E.g.

```json
"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.

Add this here: https://phenopacket-schema.readthedocs.io/en/latest/schema.html

Contributor guide

Open the contributing guide

Research direction

Start at the schema.html documentation page linked in the issue and review the linked Protocol Buffers JSON mapping documentation. Add a clear explanation of how snake_case protobuf fields map to lowerCamelCase JSON fields, using the time_at_last_encounter and timeAtLastEncounter example; the documentation should make the validation behavior understandable to non-proto users.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.