Skip to content
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

[Bug]: "doesn't look like a Refit interface" when inheriting empty interface from interface with refit function #1687

Open
pagdot opened this issue Apr 24, 2024 · 0 comments
Labels

Comments

@pagdot
Copy link

pagdot commented Apr 24, 2024

Describe the bug 🐞

Inheriting an empty interface from a base interface with refit methods causing it to not be detected. Seems like this issue occurs during roselyn code generation because no classes are generated for the derived interface(s)

Step to reproduce

using System;
using System.Threading;
using System.Threading.Tasks;
using Refit;
		
public interface IBaseService
{
    [Get("/resources")]
    Task<string> GetResource(string id);
}

public interface IDerivedServiceA : IBaseService
{
}

public class Program
{
	public static void Main()
	{
		var api = RestService.For<IDerivedServiceA>("https://example.com");
		Console.WriteLine(api.GetResource("abc"));
	}
}

(Tested at https://dotnetfiddle.net/ with refit package installed)

Reproduction repository

No response

Expected behavior

No error about doesn't look like a Refit interface. Provided example should only stumble when trying to do the actual API call because the api doesn't exist

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

No response

Version

No response

Device

No response

Refit Version

7.0.0

Additional information ℹ️

Probably happens on other (older) versions too. Reproduced it with 7.0.0 in my minimal sample

@pagdot pagdot added the bug label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant