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
Describe the bug
Headers attribute placed at the interface level of an inherited interface does not work.
For instance if you have
public interface IWebApi : IAccountApi
{
void Foo(); //hack to make api not error when using only inherited methods
}
[Headers("Authorization: Bearer")]
public interface IAccountApi
{
Task GetUserAccountBalance(string userId);
}
causes my integration tests that use the refit client to hang with no error or crash with no details.
Moving the [Headers()] to the method level works.
public interface IAccountApi
{
[Headers("Authorization: Bearer")]
Task GetUserAccountBalance(string userId);
}
The workaround is completely fine, but in the case where you want to use authorization for a lot of methods and or something like a version header where you would want the entire interface to use the same version, it becomes cumbersome.
Expected behavior
You would expect that the Headers attribute wouldn't cause the dotnet process to crash and or hang.
Screenshots
Environment
OS: MacOS 10.15.7
Visual Studio Mac 8.8.5
Asp.Net Core API v3.1
Additional context
My refit api interfaces are in a separate project so they can be shared between integration tests and my mobile client.
The text was updated successfully, but these errors were encountered:
Describe the bug
Headers attribute placed at the interface level of an inherited interface does not work.
For instance if you have
causes my integration tests that use the refit client to hang with no error or crash with no details.
Moving the
[Headers()]
to the method level works.The workaround is completely fine, but in the case where you want to use authorization for a lot of methods and or something like a version header where you would want the entire interface to use the same version, it becomes cumbersome.
Expected behavior
You would expect that the Headers attribute wouldn't cause the dotnet process to crash and or hang.
Screenshots
Environment
Additional context
My refit api interfaces are in a separate project so they can be shared between integration tests and my mobile client.
The text was updated successfully, but these errors were encountered: