GitHub - marhan/rest-patch-sample: Sample project for RESTful services with HTTP PATCH variants
The intention of this project is to experiment with RFC7386 (JSONMerge Patch) and RFC 6902 (JSON Patch) implementations. None of the implemented variants are meant to be best or good practices.
Run tests
Run application
Use application
Please find some HTTP PATCH example calls for the three different endpoints. HTTPie is used to call the API. Therefore, you need to install it, if you want to use the commands below directly in your terminal.
There is also a Postman collection in /doc folder.
JSON MERGE PATCH - V1
http PATCH :10000/v1/persons/1 name="Test Name" Content-Type:application/merge-patch+json
JSON MERGE PATCH - V2
http PATCH :10000/v2/persons/1 name="Test Name" Content-Type:application/merge-patch+json
JSON PATCH - V3
echo '[{ "op": "replace", "path": "/name", "value": "Test Name" }]' | http PATCH :10000/v3/persons/1 Content-Type:application/json-patch+json