JornWildt / Mason

Documentation and examples for the Mason media type
MIT License
114 stars 6 forks source link

Discussion: Support JSON-Patch #7

Open JornWildt opened 10 years ago

JornWildt commented 10 years ago

Should JSON-Patch be supported as an action type? Mason already have "json" + "json+files" support so it seems some what reasonable to support partial updates through JSON-Patch too.

Something like this:

"@actions": { "update": { "type": "json-patch", "href": "...", } }

But what if we support both full updates and partial updates - should they have different action names or should we have multiple actions for the same action name (just as we can have multiple links for the same link rel)?

I think I would go for different action names, such that we get:

"@actions": { "partial-update": { "type": "json-patch", "href": "...", "method": "PATCH" }, "update": { "type": "json", "href": "...", "method": "POST" } }