From 3279ec74064f2c70aa0a90cea9fbe66fc592eabe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:33:13 -0700 Subject: [PATCH] [DOCS]: Fix typo in patch examples (#72) * Fix typo and cleanup section features --------- Co-authored-by: Brenton Farmer --- docs/jsonpatch.md | 23 ++++++++++------------- docs/jsonpointer.md | 15 +++++---------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/docs/jsonpatch.md b/docs/jsonpatch.md index 2929876..0585b30 100644 --- a/docs/jsonpatch.md +++ b/docs/jsonpatch.md @@ -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 @@ -40,9 +42,9 @@ var patch = """ """; var document = JsonDocument.Parse( json ); -var jsonPath = JsonSerializer.Deserialize( patch ); +var jsonPatch = JsonSerializer.Deserialize( 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.FromPointer( node, "/store/book/0/title" ); Console.WriteLine( value ); // Output: "New Book" @@ -72,9 +74,9 @@ var patch = """ """; var node = JsonNode.Parse( json ); -var jsonPath = JsonSerializer.Deserialize( patch ); +var jsonPatch = JsonSerializer.Deserialize( 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.FromPointer( node, "/store/book/0/title" ); Console.WriteLine( value ); // Output: "New Book" @@ -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. diff --git a/docs/jsonpointer.md b/docs/jsonpointer.md index 25fd2fa..0406328 100644 --- a/docs/jsonpointer.md +++ b/docs/jsonpointer.md @@ -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 @@ -59,10 +61,3 @@ var value = JsonPointer.FromPointer(node, "/store/book/1/category") Console.WriteLine(value.GetValue()); // 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. -