datacommonsorg/mixer

Improve return format of places-in

tjann opened this issue · 0 comments

tjann commented

The current /node/places-in return format is like

[{\"dcid\":\"geoId/06\",\"place\":\"geoId/06001\"},{\"dcid\":\"geoId/06\",\"place\":\"geoId/06003\"}...{\"dcid\":\"geoId/04\",\"place\":\"geoId/04005\"},{\"dcid\":\"geoId/04\",\"place\":\"geoId/04007\"}]

I'd expected something more like what we have for Python:

{
  'geoId/06': [
    'geoId/06001',
    'geoId/06003',
    'geoId/06005',
    'geoId/06007',
    'geoId/06009',
    ...
  ],
  'geoId/04': [
    'geoId/04005',
    'geoId/04007',
    ...
  ]
}

I chatted offline with @shifucun , who said the REST return format is an old design decision. He proposed adding a new API /place/contained?dcids=... and slowly deprecate /node/places-in.