wellcomecollection / content-api

📖 The API + ETL pipeline for searching the Wellcome Collection Prismic Repository.
MIT License
0 stars 0 forks source link

Discussion: Moving away from Prismic IDs #129

Open rcantin-w opened 6 months ago

rcantin-w commented 6 months ago

While writing an RFC for the Events endpoints, we also started questioning our use of the Prismic IDs across the API. We posted about it on Slack and Robert replied with a suggestion that deserves its own ticket/discussion, so we're creating this to unblock the original RFC.

Challenge

We currently mostly work with Prismic IDs (e.g. format=WcKmiysAACx_A8NR), the exceptions being boolean filters and strings (enums). It makes URLs hard to read, plus, since the content-api’s raison d’être is, at least partly, about decoupling our content from Prismic, it’s something we’d like to address. But how? Our only other option is using the labels.

Pros:

Cons:

Suggested solution

[!NOTE] Auto-generating stable URL ids from labels can be problematic (imagine the inappropriate slug you could generate by truncating some label) so they must be editable somewhere, or at least cause a redirection to another slug.