Org Web Adapter

hungryroot/jira/be_7945_remove_cookbook_collections_endpoints_add_collection_ids.org

ID
be7945-remove-cookbook-collections-endpoints-add-collection-ids

BE-7945 Remove /cookbook/collections/* endpoints from V3 and add collection_ids to Discover Home collections

- source :: https://hungryroot.atlassian.net/browse/BE-7945

- tags :: Hungryroot API Project

- epic :: EP-627 Exp 232: Cookbook MVP

- sprint :: [[id:sprint-112][HR BE Sprint 112]]

- status :: Development in Progress

- priority :: Medium

Context

The V3 API currently exposes ~CookbookCollection~ as a first-class sub-resource

under ~/api/v3/cookbooks/collections/~ and ~/api/v3/cookbooks/collections/<slug>/~.

These endpoints are being removed; clients that need collection membership should

read a new ~collection_ids~ field on each cookbook in the list/detail responses.

Acceptance Criteria

- [ ] ~/cookbook/collections/*~ endpoints removed from V3 URL routing

- [ ] Cookbook list and detail responses include a ~collection_ids~ field (list of ints)

- [ ] Existing tests updated; new tests for ~collection_ids~ field

Work

TODO Audit current V3 collection endpoints and any clients that reference them

TODO Add ~collection_ids~ to ~CookbookSerializer~ (and ~CookbookListSerializer~)

TODO Populate ~collection_ids~ from the existing ~collections~ prefetch / annotation

TODO Remove ~CookbookCollectionListView~ and ~CookbookCollectionDetailView~ from V3 urls

TODO Remove or update ~CookbookCollectionSerializer~ if no longer needed elsewhere

TODO Update tests — remove collection endpoint tests, add ~collection_ids~ assertions

API

#+begin_src

GET /api/v3/cookbooks/ → results[].collection_ids: [1, 3, …]

GET /api/v3/cookbooks/<slug>/ → collection_ids: [1, 3, …]

#+end_src

Removed:

#+begin_src

GET /api/v3/cookbooks/collections/

GET /api/v3/cookbooks/collections/<slug>/

#+end_src

Notes

- ~CookbookCollectionSummarySerializer~ is still used in the existing ~collections~ nested field;

keep it until that field is also removed or confirm it is already gated behind the deprecation flag

- Check whether any non-V3 route (V2 write endpoint) still uses the collection endpoints before deleting