Why is the API returning sometimes an integer, sometimes a string in the JSON response metadata?

Alright, so it looks like it’s not going to be looked into.

For anyone else coming here with this issue, there is a workaround, not a fix, where you can make the types generic and manually create your own conversions in Golang if you use interfaces, you can likely do this in whatever other language you’re using (this is also working in a C# backend service we’re running).

It just takes some manual set up and some basic knowledge of type conversions. However, this of course means that some assumptions need to be made and type safety is no longer quite so safe, in addition whatever is causing these issues could be causing incorrect data being exposed from Epicollect’s API.

Hopefully this will be corrected on Epicollect’s actual API, but their lack of response looks as though it’s not a priority for them.

1 Like