Closed Zawar92 closed 2 years ago
Can you please describe your problem more?
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.
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
So exactly what happens is that:
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.
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
The schemas for certain streams like
change overtime. Mostly these errors are caused by decimal values as type integer. Can you look as these changes effect our test cases.