Overriding
#links= has the same meaning as specifying a
:setter (which you could also do!). Now, let me ask you, why would a client change a link and send it in a PATCH request? Can you give me an example for that use case?
Regarding your domain problem:
I had a look at JSON-PATCH and also a chat with Mike Kelly about a new format I came up with called "Object-HAL". This format is based on HAL and adds application semantics, like updating, replacing, adding properties, collections, collection items without the pain that JSON PATCH brings.
With all respect, but this is too low-level. The idea of JSON-PATCH is great as it specifies a generic way, however, our domain is models and objects and not JSON documents, so my idea was to abstract this to a usable level.
{
songs: [
{id: 1, title: "Mandarin", _op: "update"}
]
}
As you can see, you can specify operations per object. This goes hand in hand with Representable's deserializers which are ready to process documents like that.
If you could name some more use cases for updating/replacing/... nested collections, that could help me defining that Object-HAL semantics.