Skip to content

Commit

Permalink
[DOCS]: Fix typo in patch examples (#72)
Browse files Browse the repository at this point in the history
* Fix typo and cleanup section features

---------

Co-authored-by: Brenton Farmer <[email protected]>
  • Loading branch information
github-actions[bot] and bfarmer67 authored Aug 3, 2024
1 parent 9fb9379 commit 3279ec7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
23 changes: 10 additions & 13 deletions docs/jsonpatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ nav_order: 2

# Hyperbee JsonPatch

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.
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.

## Features

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

## Usage

Expand Down Expand Up @@ -40,9 +42,9 @@ var patch = """
""";

var document = JsonDocument.Parse( json );
var jsonPath = JsonSerializer.Deserialize<JsonPatch>( patch );
var jsonPatch = JsonSerializer.Deserialize<JsonPatch>( patch );

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

var node = JsonNode.Parse( json );
var jsonPath = JsonSerializer.Deserialize<JsonPatch>( patch );
var jsonPatch = JsonSerializer.Deserialize<JsonPatch>( patch );

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

## Why Choose Hyperbee JsonPatch?

- **Fast and Efficient:** Designed for high performance and low memory usage.
- **Versatile:** Works seamlessly with both `JsonElement` and `JsonNode`.
- **Standards Compliant:** Adheres strictly to RFC 6902 for JSON Patch.
15 changes: 5 additions & 10 deletions docs/jsonpointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ nav_order: 3

# Hyperbee JsonPointer

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.
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.

## Features

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

## Usage

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

Console.WriteLine(value.GetValue<string>()); // Output: "science"
```

## Why Choose Hyperbee JsonPointer?

- **Fast and Efficient:** Designed for high performance and low memory usage.
- **Versatile:** Works seamlessly with both `JsonElement` and `JsonNode`.
- **Standards Compliant:** Adheres strictly to RFC 6901 for JSON Pointer.

0 comments on commit 3279ec7

Please sign in to comment.