GetCovidData: {"data": null } returns error
Closed this issue · 7 comments
marekaf commented
{"data": null }
results in
{"error":{"code":3,"message":"Validation of the request has failed: validator: (nil)"}}%
but success is expected (as date is not mandatory)
marekaf commented
@jendakol is it expected to return that error for {"data": null}
from validation or is that a bug? https://github.com/covid19cz/erouska-backend/blob/develop/internal/utils/http/http.go#L93
jendakol commented
I didn't think about it yet but... from the perspective you, in fact, don't fill in a required field, it makes sense, doesn't it? 🤔
marekaf commented
I guess.
Btw for
{"data":{}}
it works as expected (ends up as successful request)
jendakol commented
Seems good to me.
So to summarize:
{}
- invalid{"data": null}
- invalid{"data": {}}
- valid
Is it ok? I think it's both current and correct behavior.
ashhanai commented
IMHO having {"data": null}
as valid input would be nice, but we are able to send {"data": {}}
via Firebase SDK so it is not an issue for us anymore and can be closed.
marekaf commented
thanks!