Repository navigation
Refit 13.1: Can a parameter no longer be both a path parameter and a header? #2279
|
Hi, After upgrading from Refit 13.0.0 to 13.1.0, one of our API interfaces stopped working. We have a method like this public interface IFooApi
{
[Get("/api/foo/{fooId}")]
Task<FooResponse> GetFoo([AliasAs("fooId")][Header("X-FooId")] long fooId);
}The intention was for the same parameter to be used as the path param and the header I noticed the 13.1 release notes mention
I'm wondering if this change intentionally removed support for using multiple bindings on the same parameter The change seems to be duplicating the value into two parameters which would have worked regardless the version [Get("/api/foo/{fooId}")]
Task<FooResponse> GetFoo(long fooId, [Header("X-FooId")] long headerFooId);Is duplicating the parameter now the recommended approach, or is there another way to achieve this that I'm not aware of? Thanks! |
Replies: 2 comments 2 replies
|
I will look into this, it seems to be a Bug on the code generation Have you tried by the way with 14.0? |
|
Thanks for the report. This is confirmed as a source-generator regression and is now tracked in issue #2280. Closing this discussion in favor of the issue. |
Thanks for the report. This is confirmed as a source-generator regression and is now tracked in issue #2280. Closing this discussion in favor of the issue.