You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSONPatch is a a swift module implements json-patch [RFC6902](https://tools.ietf.org/html/rfc6902). JSONPatch uses [JSONSerialization](https://developer.apple.com/documentation/foundation/jsonserialization) from Foundation, and has no dependencies on third-party libraries.
3
+
4
+
The implementation uses the [JSON Patch Tests](https://github.com/json-patch/json-patch-tests) project for unit tests to validate its correctness.
5
+
6
+
The module currently only supports applying json-patches, and does not support generating a patch based on the differences between two json documents.
7
+
8
+
# Release
9
+
0.1 - Initial Release
10
+
11
+
# Usage
12
+
```swift
13
+
importJSONPatch
14
+
15
+
let jsonstr ="""
16
+
{"foo": "bar"}
17
+
"""
18
+
let patchstr ="""
19
+
{"op": "add", "path": "/baz", "value": "qux"}
20
+
"""
21
+
22
+
let json =Data(jsonstr.utf8)
23
+
let patch =try!JSONPatch(data: Data(patchstr.utf8))
0 commit comments