Comments (3)
The PATCH method itself doesn't not define the details of how to actually achieve the PATCH. That is by design. The media types you have found are the two JSON based patch documents that provide these details. Both are valid approaches. Each have their strengths and weaknesses. The second option is definitely the better option for removing things.
from api-guidelines.
Thank you for your answer! I thought it would be useful to mention this in the guidline, as there is written about 'update' (which could be including remove..) and 'add' (UPSERT).
Is there any special reason, why the second one is better for removing things?
from api-guidelines.
JSON-Patch has an explicit remove operation that can act on any part of the document using a JSON-Pointer. JSON-Merge-Patch requires you to recreate the structure of the target document and use a null value to indicate removal of properties. What happens if null is a valid value for a property?
Removing elements in an array requires sending a copy of the array with the target element removed. This can be less than idea if it is an array of objects.
To be honest, I haven't used JSON Merge patch much, but I have spent many hours trying to resolve issues around doing merge patching. I have written a .Net library for JSON-Patch so maybe I'm just biased :-)
from api-guidelines.
Related Issues (20)
- Complex type pattern
- Delete pattern
- State machine pattern HOT 1
- Throttling pattern
- Graph specific HTTP Request/Response
- Shared Type Design Pattern
- HTTP Return Codes don't mention HTTP HEAD HOT 8
- Vanity url is broken with leading slash HOT 2
- Guidance on response payload with 201
- arbitrary JSON pattern/anti-pattern
- Add guidance for pageable post operations
- Fix content table in the main Graph guidelines. merger enum and evolvable enum patterns
- querying arbitrary number of keys in a dictionary insted HOT 1
- Add clarity to expand requirement
- The 'at' naming convention
- Xbox box 360 live
- Vague guidelines about point query support
- Error message localization HOT 1
- Restrictions for openType
- ??
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-guidelines.