davemachado / public-api

Public API for the public-apis Github project

Home Page:https://api.publicapis.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: /random filter parameters

adam-lynch opened this issue · comments

I built a little Twitter bot that tweets about open APIs. It would be really handy if I could do /random?auth=null. Right now I use /entries?auth=null and pick one at random myself.

I can make a pull-request but I just wanted to make sure you're OK with it first. I was thinking I'd change the random handler to do what the entries handler does then only return one random entry.

P.S. My Go skills aren't amazing so I could be wrong, but from playing with the tests, there seems to be gaps? Take the random handler test for example, the response body isn't tested and it seems to be { "count": 0, "entries": null }

Hi @adam-lynch , thanks for opening this issue! I actually had a bit of free time, so I wrote up the requested change in Pull Request #11 (though I appreciate you opening an issue before starting to implement). I've also cleaned up some of the unit test coverage to check the response body content in various tests. Thanks for your interest in the project!

Fixed in a5d59ff


ezoic increase your site revenue