Tiny Tiny RSS: Community

getCategories returns mixed int/string for int values

tt-rss version: v20.06-697418f86

When making queries to the api for getCategories I get results like this:


As you can see, id and unread come sometimes as ints, sometimes as strings.
This makes json parsing libraries like Go’s json to fail, or forces you to use an empty interface for something that’s clearly an int.

I’m not a PHP developer, but I think I have a patch that can work. I’ve seen that order_id is already casted to int, but not id nor unread. My (simple) patch does that.

I would like to open a PR for it. My username at Gogs is e1e0.

sure, you should have necessary privileges now.