Closed
Description
am trying to create a custom refit attribute like this:
[AttributeUsage(AttributeTargets.Method)]
public class CustomGetAttribute : GetAttribute
{
public CustomGetAttribute(string path) : base(path) { }
}
public interface ICustomerService
{
[CustomGet("/TestMethod")]
Task TestMethod();
}
but a warning appears in visual studio output window when building the project:
D:\source\repos\RefitApiTest\packages\Refit.4.8.14\build\net461\refit.targets(30,5): warning : warning RF001: Method ICustomerService.TestMethod either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument.
and the method fails to generate in RefitStubs.g.cs?
Task ICustomerService.TestMethod()
{
throw new NotImplementedException("Either this method has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument.");
}
is it possible to create custom refit attributes?