sociepy / covid19-vaccination-subnational

🌍💉 Global COVID-19 vaccination data at the regional level.
https://sociepy.org/covid19-vaccination-subnational
GNU General Public License v3.0
61 stars 15 forks source link

NaN returns invalid JSON #40

Closed SamuelGHill closed 3 years ago

SamuelGHill commented 3 years ago

I am building out a GraphQL Server with StepZen and the query https://sociepy.org/covid19-vaccination-subnational/data/api/v1/latest/country_by_iso/FR.json breaks due to a NaN value rather than null value in total_vaccinations_per_100.

// Response from RestAPI

        {
            "region_name": "Corse",
            "region_iso": "FR-COR",
            "date": "2021-02-22",
            "total_vaccinations": 27059,
            "total_vaccinations_per_100": NaN
        },

GraphQL Query

  vaccines(countryISO: "FR") {
  country
  }

Response Error

{
  "data": {
    "vaccines": null
  },
  "errors": [
    {
      "message": "Invalid json content.: invalid character 'N' looking for beginning of value",
      "locations": [
        {
          "line": 58,
          "column": 3
        }
      ],
      "path": [
        "vaccines"
      ]
    }
  ]
}
lucasrodes commented 3 years ago

Hi @SamuelGHill, Thanks for your report! Also, happy to see that you find this project useful.

I will start working on this asap, I'll ping you when fixed.

lucasrodes commented 3 years ago

@SamuelGHill Could you check now? Thanks!

Also, I'd be happy to learn more about your project 😄 Further feedback is welcome so I can improve the API part of this project.

SamuelGHill commented 3 years ago

@lucasrodes

Works! Thank you for the quick fix.

And yes, I'd be more than happy to. I'll share my project with you and see what collaborations we can do!