Skip to content

Commit 3279ec7

Browse files
[DOCS]: Fix typo in patch examples (#72)
* Fix typo and cleanup section features --------- Co-authored-by: Brenton Farmer <[email protected]>
1 parent 9fb9379 commit 3279ec7

2 files changed

Lines changed: 15 additions & 23 deletions

File tree

docs/jsonpatch.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ nav_order: 2
66

77
# Hyperbee JsonPatch
88

9-
Hyperbee JsonPatch is a high-performance library for applying JSON patches to JSON documents, as defined in [RFC 6902](https://www.rfc-editor.org/rfc/rfc6902.html). It supports both `JsonElement` and `JsonNode`, allowing for efficient and flexible modifications of JSON data.
9+
Hyperbee JsonPatch is a high-performance library for applying JSON patches to JSON documents, as defined in [RFC 6902](https://www.rfc-editor.org/rfc/rfc6902.html).
10+
It supports both `JsonElement` and `JsonNode`, allowing for efficient and flexible modifications of JSON data.
1011

1112
## Features
1213

13-
- **High Performance:** Optimized for speed and low memory allocations.
14-
- **Supports:** `JsonElement` and `JsonNode`.
15-
- **RFC Conformance:** Fully adheres to RFC 6902 for reliable behavior.
14+
- **High Performance:** Optimized for speed and efficiency.
15+
- **Low Memory Allocations:** Designed to minimize memory usage.
16+
- **Conformance:** Fully adheres to RFC 6902 for JSON Patch.
17+
- **Supports both `JsonElement` and `JsonNode`:** Works seamlessly with both JSON document types.
1618

1719
## Usage
1820

@@ -40,9 +42,9 @@ var patch = """
4042
""";
4143

4244
var document = JsonDocument.Parse( json );
43-
var jsonPath = JsonSerializer.Deserialize<JsonPatch>( patch );
45+
var jsonPatch = JsonSerializer.Deserialize<JsonPatch>( patch );
4446

45-
jsonPath.Apply( document.RootElement, out var node ); // Apply updates a JsonNode (since elements cannot be modified)
47+
jsonPatch.Apply( document.RootElement, out var node ); // Apply updates a JsonNode (since elements cannot be modified)
4648
4749
var value = JsonPathPointer<JsonNode>.FromPointer( node, "/store/book/0/title" );
4850
Console.WriteLine( value ); // Output: "New Book"
@@ -72,9 +74,9 @@ var patch = """
7274
""";
7375

7476
var node = JsonNode.Parse( json );
75-
var jsonPath = JsonSerializer.Deserialize<JsonPatch>( patch );
77+
var jsonPatch = JsonSerializer.Deserialize<JsonPatch>( patch );
7678

77-
jsonPath.Apply( node ); // Apply modifies the JsonNode in place (does rollback changes if an error occurs)
79+
jsonPatch.Apply( node ); // Apply modifies the JsonNode in place (does rollback changes if an error occurs)
7880
7981
var value = JsonPathPointer<JsonNode>.FromPointer( node, "/store/book/0/title" );
8082
Console.WriteLine( value ); // Output: "New Book"
@@ -117,8 +119,3 @@ var patch = JsonSerializer.Serialize( patchOperations );
117119
Console.WriteLine( patch ); // Output: [{"op":"add","path":"/last","value":"Doe"}]
118120
```
119121

120-
## Why Choose Hyperbee JsonPatch?
121-
122-
- **Fast and Efficient:** Designed for high performance and low memory usage.
123-
- **Versatile:** Works seamlessly with both `JsonElement` and `JsonNode`.
124-
- **Standards Compliant:** Adheres strictly to RFC 6902 for JSON Patch.

docs/jsonpointer.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ nav_order: 3
66

77
# Hyperbee JsonPointer
88

9-
Hyperbee JsonPointer provides a simple and efficient way to navigate JSON documents using pointer syntax, as defined in [RFC 6901](https://www.rfc-editor.org/rfc/rfc6901.html). It supports both `JsonElement` and `JsonNode`, making it a versatile tool for JSON manipulation in .NET.
9+
Hyperbee JsonPointer provides a simple and efficient way to navigate JSON documents using pointer syntax, as defined in [RFC 6901](https://www.rfc-editor.org/rfc/rfc6901.html).
10+
It supports both `JsonElement` and `JsonNode`, making it a versatile tool for JSON manipulation in .NET.
1011

1112
## Features
1213

1314
- **High Performance:** Optimized for speed and efficiency.
14-
- **Supports:** `JsonElement` and `JsonNode`.
15-
- **RFC Conformance:** Fully adheres to RFC 6901 for reliable behavior.
15+
- **Low Memory Allocations:** Designed to minimize memory usage.
16+
- **Conformance:** Fully adheres to RFC 6901 for JSON Pointer.
17+
- **Supports both `JsonElement` and `JsonNode`:** Works seamlessly with both JSON document types.
1618

1719
## Usage
1820

@@ -59,10 +61,3 @@ var value = JsonPointer<JsonNode>.FromPointer(node, "/store/book/1/category")
5961

6062
Console.WriteLine(value.GetValue<string>()); // Output: "science"
6163
```
62-
63-
## Why Choose Hyperbee JsonPointer?
64-
65-
- **Fast and Efficient:** Designed for high performance and low memory usage.
66-
- **Versatile:** Works seamlessly with both `JsonElement` and `JsonNode`.
67-
- **Standards Compliant:** Adheres strictly to RFC 6901 for JSON Pointer.
68-

0 commit comments

Comments
 (0)