marlon360 / rki-covid-api

🦠🇩🇪📈 An API for the spread of covid-19 in Germany. Data from Robert-Koch-Institut.
https://api.corona-zahlen.org/
Creative Commons Attribution 4.0 International
250 stars 50 forks source link

Schemas change for certain streams #438

Closed Zawar92 closed 2 years ago

Zawar92 commented 2 years ago

The schemas for certain streams like

  1. germany_age_groups
  2. german_history_hospitalization

change overtime. Mostly these errors are caused by decimal values as type integer. Can you look as these changes effect our test cases.

Rubber1Duck commented 2 years ago

Can you please describe your problem more?

Zawar92 commented 2 years ago

Our problem arises, when change in schemas occurs. Lets say stream passing a type float changes to integer. That causes the test cases to fail.

Rubber1Duck commented 2 years ago

I am realy sorry, but i dont understand your issue ......... you ask for "Can you look as these changes effect our test cases." What do you meen with "Our problem" who is "our" ? What is "the test cases" or "our test cases"? In general this API passes on the numbers as published by the RKI. As i know all numbers should be right. I would be happy if you could show an example (possibly with a screenshot) where you think something is wrong there. The last changes to endpoints "/germany/age_groups" and "/germany/history/hospitalization" is a long time ago! (as i remember there the source data is changed from RKI excel file to RKI github hospitalization csv file) should there have been a change in the last few days, please describe exactly what has changed

Zawar92 commented 2 years ago

So exactly what happens is that:

  1. Screen shot shows the current stream values
Screenshot 2022-05-17 at 21 51 07
  1. Screen Shows the current schema
Screenshot 2022-05-17 at 21 53 18

Before today some of the values type were not integer they were number and vice versa. So for that I had to change the type or add "type": ["number", "integer"] in order to avoid failing of test. Can this occur in other streams as well? or only in hospitalization stream.

Rubber1Duck commented 2 years ago

in /src/data-requests/hospitalization.ts you can see what is defined for hospitalization. There is no difference between integer and float, it is always just a number! see also https://www.typescriptlang.org/docs/handbook/2/everyday-types.html number is for numbers like 42. JavaScript does not have a special runtime value for integers, so there’s no equivalent to int or float - everything is simply number https://github.com/marlon360/rki-covid-api/blob/a216f1d160b4e1156a3b6b948ea918fd1061fa47/src/data-requests/hospitalization.ts#L5-L52

And this is for every Endpoint (you call it stream) the case! For your question Can this occur in other streams as well? definitely YES

All "numbers" should by type number or "type": ["number", "integer"] if you must do the difference!

hope that helps, and If you are satisfied with this answer please close the issue