Nested Interfaces and Mega Classes #1651
chrstophr-wltrs
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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