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
Hi everyone 👋 I'm working on some integration tests for a handful of very large ASP.NET applications. In the source code, these endpoints are split up into "controllers", and I'm trying to have my test code somewhat mirror that. It also makes sense to have related methods in different files from a logical perspective. Let's say I have an "Admin" API and an "External" API. For the Admin API, I might have some interfaces in different files like this:
Of course, when you have three or more interfaces with the same name in one project, Refit refuses to auto-generate implementations of those interfaces, even if they're in different namespaces.
One possible solution is to instead generate a single interface using partials:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone 👋 I'm working on some integration tests for a handful of very large ASP.NET applications. In the source code, these endpoints are split up into "controllers", and I'm trying to have my test code somewhat mirror that. It also makes sense to have related methods in different files from a logical perspective. Let's say I have an "Admin" API and an "External" API. For the Admin API, I might have some interfaces in different files like this:
And the External API would look like this:
Of course, when you have three or more interfaces with the same name in one project, Refit refuses to auto-generate implementations of those interfaces, even if they're in different namespaces.
One possible solution is to instead generate a single interface using partials:
This means that every method must have a unique name across the entire API, which does end up feeling pretty redundant and silly.
I was wondering, does anyone know if there's some way to structure your interfaces such that you could consume it like this?
That's probably too specific for an auto-generator, but it seemed like it wouldn't hurt to ask.
Beta Was this translation helpful? Give feedback.
All reactions