Open lanthaler opened 10 years ago
That's something we discussed in the context of authorization in the past, see issue #7. The general approach would be to either define a property or a class that you include/exclude based on the resource state. Something like
{
"@id": "just-an-entity",
"@type": [ "BlogPost", "PublishedBlogPost" ],
"comments": "just-an-entity/comments"
}
In this case, the operations that are supported on all posts are associated to the BlogPost
class. The operations only applicable to published posts are associated to the PublishedBlogPost
class. Similarly, the comments
property is just included on posts that can be commented on.
PROPOSAL: This can be achieved by either including operation directly in the resource's representation or by using specialized subclasses that convey the resource's current state. Describe both approaches in the specification.
_This was raised a couple of times, most recently by James Langley:_