Skip to content

AddUrlSegment accepts object values but internally casts to strings causing exception #1682

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

Closed
Guerra24 opened this issue Jan 6, 2022 · 6 comments

Comments

@Guerra24
Copy link

Guerra24 commented Jan 6, 2022

This change 8e96bba#diff-5df1c2c9f9f84319d21c361a0a336251f7698927e2f1c0b0adab575fa407c6e6 simply casts object values into strings, this is causing issues since the public api accepts object values.

@alexeyzimarev
Copy link
Member

alexeyzimarev commented Jan 6, 2022

It would also be nice if you actually follow the contribution guidelines and provide stack trace and exception details.

But, I see what happens. Will try to fix it tomorrow.

@Guerra24
Copy link
Author

Guerra24 commented Jan 6, 2022

First of all thanks for the quick fix!

It would also be nice if you actually follow the contribution guidelines and provide stack trace and exception details.

Sorry about that. I thought pointing out the source of the issue and why it was an issue was descriptive enough. Will keep that in mind for next time.

@alexeyzimarev
Copy link
Member

You're right. I got it right after looking into the links you provided. I usually scan the issue content, and when it has no stack trace, it looks incomplete to me :)

@alexeyzimarev
Copy link
Member

Btw I made constructors for all parameter types (except the abstract one) more explicit. The old AddParameter has to, of course, accept object? but then I try converting those values to string, not cast them.

Also, AddParameter overload that doesn't accept the parameter type enum, as well as all AddXXXParameter now have explicit string or string? where it's appropriate (not files and body parameters).

@alexeyzimarev
Copy link
Member

It will break some existing code of course... I understand that you got this error when passing something like a number or a boolean. Not sure how to fix it better. Maybe I need to return the overload that accepts object? It might lead to boxing though, need to check.

@alexeyzimarev
Copy link
Member

Made this, and it clearly shows the boxing issue. Not such a big issue though.
image

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

No branches or pull requests

2 participants