JsonCompareDiff 1.0.4
dotnet add package JsonCompareDiff --version 1.0.4
NuGet\Install-Package JsonCompareDiff -Version 1.0.4
<PackageReference Include="JsonCompareDiff" Version="1.0.4" />
<PackageVersion Include="JsonCompareDiff" Version="1.0.4" />
<PackageReference Include="JsonCompareDiff" />
paket add JsonCompareDiff --version 1.0.4
#r "nuget: JsonCompareDiff, 1.0.4"
#:package JsonCompareDiff@1.0.4
#addin nuget:?package=JsonCompareDiff&version=1.0.4
#tool nuget:?package=JsonCompareDiff&version=1.0.4
📝 JSON Compare Utility
Welcome to the JSON Compare Utility repository! 🚀
This project offers a tool to compare two JSON strings and identify the differences between them. It is ideal for tracking changes in structured data, such as logs or configurations, in a clear and organized manner.
🌟 Features
JSON Comparison: Compare two JSON strings and get all the differences. Ignore Keys: Specify keys that should be ignored during the comparison. Difference Details: Identify insertions, updates, and deletions of values.
📚 Documentation
CompareJson: Compares two JSON strings and returns the differences. HasDifference: Checks if there are differences between two simple JSON strings. DifferenceDetails: Details the differences found, categorizing them into insertions, updates, and deletions.
🔧Requirements
Newtonsoft.Json: Ensure you have the Newtonsoft.Json package installed to use the tool.
🛠️ Usage Example
Imagine you are developing a user profile monitoring system and need to check for changes in profile data after updates.
Run the TestRun project and understand its functionality.
Before: ⬅️
{
"Name": "John Doe",
"Age": 30,
"Address": {
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
},
"Skills": ["C#", "SQL", "JavaScript"]
}
After: ➡️
{
"Name": "John Doe",
"Age": 31,
"Address": {
"Street": "123 Main St",
"City": "New Haven",
"State": "NY"
},
"Skills": ["C#", "SQL", "Python"]
}
Expected Response: 🥳
{
"Age": {
"updated": [31]
},
"Address": {
"City": {
"updated": ["New Haven"]
}
},
"Skills": {
"removed": ["JavaScript"],
"added": ["Python"]
}
}
The compared values can also come from a database, using the more traditional JSON style with \ delimiting the JSON and not just dictionaries.
✅ Benefits:
Traceability: Quickly identify changes in user profile data. Efficiency: Reduce time spent analyzing large amounts of JSON data. Flexibility: Ignore specific keys that are not relevant for the comparison.
🚀 Getting Started
Clone the repository: git clone https://github.com/robsongjunior/JsonCompare Open the project in your preferred IDE. Install the necessary dependencies. Use the Compare class to compare your JSONs!
⚠️ I am providing this code as fully open, free, and without any liabilities for its use. The primary goal is to strengthen the open-source community and promote learning. This code is not intended for commercial purposes and should not be used as such. Feel free to study, modify, and distribute the code as you wish, always respecting the principles of the open-source community. The repository is open for contributions, and everyone is welcome to collaborate to further improve this project.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4 | 168 | 6/7/2024 |