✅ Refit / RestLess API SDK Structure
Hey!
How do I structure an SDK for my API?
Let's say I have 2 resources: Users and Groups.
I could use Refit or RestLess to create an interface which wraps the CRUD operations on both resources.
However if I add more resources (which I do have) to the interface it gets messy.
Is there a way to structure my API SDK like this?
Where
IMyUsersApi
and IMyGroupsApi
would contain all CRUD operations for their resource.5 Replies
Anyone?
What's your problem? Can't you do just that -- have one class which contains a Refit interface for users, and one for groups?
Can you? I haven't seen documention about it.
I've seen others having one big interface having all methods for every endpoint inside it
You can just create a class?
No need to get Refit involved there
(or whatever the refit syntax is)
Oh I see
Wow that's actually really simple
Didn't think of that somehow
You really saved me from a lot of headaches😂