Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: /random filter parameters #10

Closed
adam-lynch opened this issue Feb 3, 2019 · 3 comments
Closed

Feature request: /random filter parameters #10

adam-lynch opened this issue Feb 3, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@adam-lynch
Copy link

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 }

davemachado pushed a commit that referenced this issue Feb 4, 2019
Fixes issue #10. Along with allowing the /random endpoint to accept a
search request filter, we have done some unit test refactoring.
davemachado added a commit that referenced this issue Feb 4, 2019
Fixes issue #10. Along with allowing the /random endpoint to accept a
search request filter, we have done some unit test refactoring.
davemachado added a commit that referenced this issue Feb 4, 2019
Fixes issue #10. Along with allowing the /random endpoint to accept a
search request filter, we have done some unit test refactoring.
davemachado added a commit that referenced this issue Feb 4, 2019
Fixes issue #10. Along with allowing the /random endpoint to accept a
search request filter, we have done some unit test refactoring.
@davemachado
Copy link
Owner

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!

@davemachado davemachado added the enhancement New feature or request label Feb 4, 2019
@davemachado davemachado self-assigned this Feb 4, 2019
@davemachado
Copy link
Owner

Fixed in a5d59ff

@adam-lynch
Copy link
Author

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants