Let's say I have a REST api endpoint that is getting a resource called a "purchasable" (an item that a user can purchase). Here is an example of what this might look like.
Endpoint: GET /purchasables/253
Responds with:
{
"id": "253",
"name": "T shirt",
"price": 1234,
"discounts": [
....
]
}
So this purchasable object has an id, a name, and a price that never changes. But let's say the discounts array is different based on the user who is making the request (so it could have different things for different users). Is that some sort of anti-pattern that has a name?
I see one potential downside is that caching this object is now more difficult, as we can't just store a copy of that item based on its id property now. This pattern just sort of smells to me and I can't find anyone talking about this specifically.