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

[FEAT/BUG] Automatically convert arguments of path/query to string #11

Open
1 of 2 tasks
icaine opened this issue Apr 2, 2021 · 3 comments
Open
1 of 2 tasks
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@icaine
Copy link

icaine commented Apr 2, 2021

  • Bug part: I was trying to do something like .add_path(['user', 123]) and it didn't raise an exception during the execution of the method but only when i called .get, which is imho late.

  • Feature request: Everything should be converted to str automatically (not raising error) or at least usual types like int, float. I think it should be user's responsibility to provide desired str output and everyone knows that resulting url is always str.

@icaine icaine added the enhancement New feature or request label Apr 2, 2021
@MicaelJarniac MicaelJarniac added the bug Something isn't working label Apr 3, 2021
@MicaelJarniac
Copy link
Owner

Nice catch! Will get to fixin'.

@MicaelJarniac MicaelJarniac self-assigned this Apr 3, 2021
MicaelJarniac added a commit that referenced this issue Apr 3, 2021
`add_path` now uses `*args`
`add_query` now uses both `*args` and `**kwargs`
Closes #13

`add_path` now checks individual types inside given list
Related to #11

BREAKING CHANGE: Modified parameter names for `add_path` and `add_query`
@MicaelJarniac
Copy link
Owner

For now, I've only made it raise an AttributeError if it receives a list and it has something other than str inside.

I'm still thinking of a good way to implement the automatic conversion part.

@icaine
Copy link
Author

icaine commented Apr 3, 2021

In my wrapper function that i am using to bypass some problems that i encoutered (and reported) i use something as simple as [str(p) for p in path_parts].

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

No branches or pull requests

2 participants