remove non ascii whitespaces
This commit is contained in:
parent
598a10bc28
commit
5a6d6c4d13
117 changed files with 1928 additions and 1928 deletions
|
@ -39,7 +39,7 @@ A JSON Patch document is just a [JSON](../files/JSON.md) file containing an arra
|
|||
## JSON Pointer
|
||||
JSON Pointer ([IETF RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901/)) defines a string format for identifying a specific value within a [JSON](../files/JSON.md) document. It is used by all operations in JSON Patch to specify the part of the document to operate on.
|
||||
|
||||
A JSON Pointer is a string of tokens separated by `/` characters, these tokens either specify keys in objects or indexes into arrays. For example, given the [JSON](../files/JSON.md)
|
||||
A JSON Pointer is a string of tokens separated by `/` characters, these tokens either specify keys in objects or indexes into arrays. For example, given the [JSON](../files/JSON.md)
|
||||
```json
|
||||
{
|
||||
"biscuits": [
|
||||
|
@ -49,13 +49,13 @@ A JSON Pointer is a string of tokens separated by `/` characters, these tokens
|
|||
}
|
||||
```
|
||||
|
||||
`/biscuits` would point to the array of biscuits and `/biscuits/1/name` would point to `"Choco Leibniz"`.
|
||||
`/biscuits` would point to the array of biscuits and `/biscuits/1/name` would point to `"Choco Leibniz"`.
|
||||
|
||||
To point to the root of the document use an empty string for the pointer. The pointer `/` doesn’t point to the root, it points to a key of `""` on the root (which is totally valid in [JSON](../files/JSON.md)).
|
||||
To point to the root of the document use an empty string for the pointer. The pointer `/` doesn’t point to the root, it points to a key of `""` on the root (which is totally valid in [JSON](../files/JSON.md)).
|
||||
|
||||
If you need to refer to a key with `~` or `/` in its name, you must escape the characters with `~0` and `~1` respectively. For example, to get `"baz"` from `{ "foo/bar~": "baz" }` you’d use the pointer `/foo~1bar~0`.
|
||||
If you need to refer to a key with `~` or `/` in its name, you must escape the characters with `~0` and `~1` respectively. For example, to get `"baz"` from `{ "foo/bar~": "baz" }` you’d use the pointer `/foo~1bar~0`.
|
||||
|
||||
Finally, if you need to refer to the end of an array you can use `-` instead of an index. For example, to refer to the end of the array of biscuits above you would use `/biscuits/-`. This is useful when you need to insert a value at the end of an array.
|
||||
Finally, if you need to refer to the end of an array you can use `-` instead of an index. For example, to refer to the end of the array of biscuits above you would use `/biscuits/-`. This is useful when you need to insert a value at the end of an array.
|
||||
|
||||
## Operations
|
||||
### Add
|
||||
|
@ -63,7 +63,7 @@ Finally, if you need to refer to the end of an array you can use `-` instead o
|
|||
{ "op": "add", "path": "/biscuits/1", "value": { "name": "Ginger Nut" } }
|
||||
```
|
||||
|
||||
Adds a value to an object or inserts it into an array. In the case of an array, the value is inserted before the given index. The `-` character can be used instead of an index to insert at the end of an array.
|
||||
Adds a value to an object or inserts it into an array. In the case of an array, the value is inserted before the given index. The `-` character can be used instead of an index to insert at the end of an array.
|
||||
|
||||
### Remove
|
||||
```json
|
||||
|
@ -75,7 +75,7 @@ Removes a value from an object or array.
|
|||
{ "op": "remove", "path": "/biscuits/0" }
|
||||
```
|
||||
|
||||
Removes the first element of the array at `biscuits` (or just removes the “0” key if `biscuits` is an object)
|
||||
Removes the first element of the array at `biscuits` (or just removes the “0” key if `biscuits` is an object)
|
||||
|
||||
### Replace
|
||||
```json
|
||||
|
@ -89,14 +89,14 @@ Replaces a value. Equivalent to a "remove" followed by an "add".
|
|||
{ "op": "copy", "from": "/biscuits/0", "path": "/best_biscuit" }
|
||||
```
|
||||
|
||||
Copies a value from one location to another within the [JSON](../files/JSON.md) document. Both `from` and `path` are JSON Pointers.
|
||||
Copies a value from one location to another within the [JSON](../files/JSON.md) document. Both `from` and `path` are JSON Pointers.
|
||||
|
||||
### Move
|
||||
```json
|
||||
{ "op": "move", "from": "/biscuits", "path": "/cookies" }
|
||||
```
|
||||
|
||||
Moves a value from one location to the other. Both `from` and `path` are JSON Pointers.
|
||||
Moves a value from one location to the other. Both `from` and `path` are JSON Pointers.
|
||||
|
||||
### Test
|
||||
```json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue