This function normalises a JSON-list. The concept of JSON-list is here
defined as an ordinary R list object whose elements are either all named or
none is named. These lists map naturally to JSON elements: objects and
arrays. What this function does is wrap certain elements of the nested
list obj
in list()
to make the tree structure of the obj
list homologous across different responses. This makes all responses of the
same entity type (studies, associations, variants or traits) homologous and
hence joinable with family functions lst_*_join
.
normalise_obj(obj, resource_url)
A normalised JSON-list.
A JSON-list. This is just an ordinary list as returned by
gc_request
or gc_request_all
.
The URL endpoint used to obtain the JSON-list obj
.
This is used to infer the type of GWAS entity returned. See
object_type_from_url
for more details.
This normalisation is GWAS object type specific. The parameter
resource_url
should be mappable to either studies, associations,
variants or traits by object_type_from_url
.