PMA-2020 / pma-api

The best way to programmatically access PMA2020 data.
http://api.pma2020.org
MIT License
1 stars 3 forks source link

Some collection resource does not include URL keys: surveys, countries... #21

Open joeflack4 opened 6 years ago

joeflack4 commented 6 years ago

Description

Survey collection resource does not include URL keys for instances shown in results.

Affected resources

In contrast, an example of a resource where this appears to have been implemented correctly is: http://api.pma2020.org/v1/indicators

Expected behavior

http://api.pma2020.org/v1/surveys

{
  "metadata": {
    ...
  }, 
  "resultSize": 48, 
  "results": [
    {
      "country.id": "GH", 
      "country.label": "Ghana", 
      "country.order": 4, 
      "country.region": "Africa", 
      "country.subregion": "Western Africa", 
      "end_date": "2013-10-01", 
      "id": "PMA2013_GHR1", 
      "order": 101, 
      "pma_code": "GHR1", 
      "round": 1, 
      "start_date": "2013-09-01", 
      "type": "PMA2020", 
      "year": 2013
      "url": "http://api.pma2020.org/v1/surveys/PMA2013_GHR1"
    }, 
    ...

Actual behavior

http://api.pma2020.org/v1/surveys

{
  "metadata": {
    ...
  }, 
  "resultSize": 48, 
  "results": [
    {
      "country.id": "GH", 
      "country.label": "Ghana", 
      "country.order": 4, 
      "country.region": "Africa", 
      "country.subregion": "Western Africa", 
      "end_date": "2013-10-01", 
      "id": "PMA2013_GHR1", 
      "order": 101, 
      "pma_code": "GHR1", 
      "round": 1, 
      "start_date": "2013-09-01", 
      "type": "PMA2020", 
      "year": 2013
    }, 
    ...