You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using both [Property] and [Query] attributes on method parameters, the query parameters are not added to the request URI, while path parameters work as expected. This behavior blocks our testing setup where we need both:
[Property] to access parameter values in test handlers
If you don't have time for that:
Would you be open to me submitting a PR with the fix and corresponding tests?
That way you'd only need to do the code review and release.
Not sure, you could try asking in slack or ping one of the main contributors. IMO it should be documented or have an error / diagnostic associated with it 🤔
Would you be open to me submitting a PR with the fix and corresponding tests?
I suspect you'd have to expand this to all attribute combinations not just your current case. This would be a breaking change and I don't know if it would be approved.
Hm - good idea, why didn't I think of that :D
Yes, this works great, it's a bit messy because the parameters are duplicated, but I don't need a complex DelegatingHandler that searches for the parameters and then appends them to the query.
This is a much better workaround, thanks for the idea :)
Is there any reason for this?
@anaisbetts
Can you say anything about this?
It looks like a bug to me, or am I missing something?
And as a small update:
My deadline before the test phase this week was postponed, luckily not by us, so I gained some more time :)
Describe the bug 🐞
When using both [Property] and [Query] attributes on method parameters, the query parameters are not added to the request URI, while path parameters work as expected. This behavior blocks our testing setup where we need both:
Environment:
Step to reproduce
ITestApi:
DebugHandler:
Program:
Uri:
Note: The path parameter is correctly replaced in the route, only the query parameters are affected.
I would expect:
Reproduction repository
No response
Expected behavior
Parameters should be accessible via Properties AND added to request URI when both attributes are present.
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
Refit Version
8.0.0
Additional information ℹ️
This issue is blocking our test phase starting next week. We need either:
I just discovered this during testing today, apologies for the urgent notice - you know how these things go!
The text was updated successfully, but these errors were encountered: