benjhar / JokeAPI-Python

An API Wrapper for Sv443's JokeAPI
GNU General Public License v3.0
33 stars 9 forks source link

Typo in build_request for the Parameter idRange #13

Closed FGeiselhart closed 2 years ago

FGeiselhart commented 2 years ago

Describe the bug There is a typo within the file main.py on line 160. When using an IdRange the string 'i&dRange' is appended to the request. But instead of 'i&dRange' the value '&idRange' needs to be added. This renders the Range-Feature useless and jokes with random IDs are returned.

To Reproduce Steps to reproduce the behavior:

  1. Use the optional IdRange Parameter

Expected behavior The idRange should be applied as a filter. Only jokes that have their IDs within the requested range should be returned.

Error and/or code snippet if id_range: r += f"i&dRange={id_range[0]}-{id_range[1]}"

Needs to be changed into: if id_range: r += f"i&dRange={id_range[0]}-{id_range[1]}"

Thanks very much!

FGeiselhart commented 2 years ago

Thank you for the fast fix!

benjhar commented 2 years ago

Thanks for making this issue!

No idea how I missed that or how it got past the tests. I'll have to look at them at some point.