C
C#3mo ago
schwartzmj

Feedback on nested API

We have entities with slugs: Teams -> Campaigns -> Products As it stands right now, each of those entities has a unique slug. Teams are globally unique, campaigns are a composite key with the team, and products to the campaigns. This ends up being /api/Teams/{teamSlug}/Campaigns/{campaignSlug}/Products/{productSlug} This is of course because the client gets URLs and needs to GET based on the slugs. This makes ALL endpoints complex like this, though. We could just update/delete with some other unique identifier like a GUID, but now our routes are pretty inconsistent. Does anybody have feedback on this? Something that worked well for them in the past? What if we wanted to have a standard GET that involved getting it by the ID as well as the slug?
1 Reply
Omnissiah
Omnissiah3mo ago
it remembers me a little bit of sharepoint and i would not interpret it as a good sign tbh but i mean it seems organized decently
Want results from more Discord servers?
Add your server