ireceptor-plus / issues

0 stars 0 forks source link

extra object level needed in stats API? #87

Open schristley opened 2 years ago

schristley commented 2 years ago

For the rearrangement/count end point, I notice there seems to be an extra object level, is this needed for some reason? Specifically, here is an example JSON post data:

{
  "repertoires": [
    {
      "repertoire": {
        "repertoire_id": "2"
      }
    },
    {
      "repertoire": {
        "repertoire_id": "3"
      }
    }
  ],
  "statistics": [
    "rearrangement_count",
    "duplicate_count"
  ]
}

The repertoire: key inside the repertoires array seems unneeded. It could simply be this as repertoires already provides the context:

{
  "repertoires": [
    {
        "repertoire_id": "2"
    },
    {
        "repertoire_id": "3"
    }
  ],
  "statistics": [
    "rearrangement_count",
    "duplicate_count"
  ]
}
bcorrie commented 2 years ago

You are correct, it could be simplified. At the moment, it is consistent with the object response where we have the same object structure in both the query and the response:

"repertoire": { "repertoire_id": "3" }

Assuming of course we fix the issue in #89 8-)

We could change it I suppose, but it isn't a bug just a difference in presentation, no?

schristley commented 2 years ago

Ok, I didn't see that correspondence at first, that makes sense to keep the same object structure in both queries and responses. Should we make that more explicit in the spec? Right now repertoire_description_object is just the IDs:

repertoire_id: 1
sample_processing_id: 2
data_processing_id: 3

should we specify that the repertoire key is part of the object, as that seems to be the intent? Otherwise the key can be anything...

repertoire:
    repertoire_id: 1
    sample_processing_id: 2
    data_processing_id: 3