Public and private attributes in a resource

I have been weighing this question for a while, and I think the best answer is tangentially related to this thread. Using multiple resources for what is essentially a constrained representation of the same resource is not a good idea. I’ve written a few responses stating this, but without an alternative it wouldn’t have been super constructive, and I think this discussion will result in the correct path.

The HTTP prefer ‘return’ header is used to tailor the request content to reduce undesired traffic. The return=minimal/representation is not appropriate, and I like where @jgornick is taking the thought with my added caveats. The conversation after that is relevant, but also somewhat parallel so the discussion is incomplete.

The fully baked answer will take time, but for the short term returning the truncated representation in the anonymous (public) or public(authorized) scenarios with cache-control: no-cache will allow you get the desired result without the many issues the separate resource model will introduce. I think in the end this interesting concept may need another HTTP status code or preference header, deciding which will certainly take a bit.

2 Likes