SkinnyJson 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SkinnyJson --version 1.3.0                
NuGet\Install-Package SkinnyJson -Version 1.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SkinnyJson" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SkinnyJson --version 1.3.0                
#r "nuget: SkinnyJson, 1.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SkinnyJson as a Cake Addin
#addin nuget:?package=SkinnyJson&version=1.3.0

// Install SkinnyJson as a Cake Tool
#tool nuget:?package=SkinnyJson&version=1.3.0                

SkinnyJson

Based on FastJson: https://github.com/mgholam/fastJSON

Nuget:

The default is usually ahead of the strong-named version

SkinnyJson has a cleaned-up interface, and handles interface based serialisation much better. SkinnyJson was designed to handle Event Store messages, and is tuned to deal with situations where a common interface declaration is available, but the original serialised objects are not available.

Common use cases:

Deserialise a known type:

IMyInterface values = Json.Defrost<IMyInterface>(jsonString);

Serialise any object to JSON:

string jsonString = Json.Freeze(myObject);

Pretty print a JSON string:

var newString = Json.Beautify(oldString);

Create a deep copy of an object:

var newObject = Json.Clone(oldObject);

Deserialise to a dynamic type for unknown schemas:

dynamic obj = Json.DefrostDynamic(jsonString);
Console.WriteLine(obj.MyProperty.MyArray[4].Prop2()); // use `()` to read a value.
var missing = obj.NotHere.child.grandchild(); // results in null. Dynamic does null propagation.

obj.MyProperty.other = "hello"; // can update properties
var updatedJson = Json.Freeze(obj); // and serialise the result

Inline editing:

string newJson = Json.Edit(oldJson, d => {
    d.myProperty.updated = true;
    d.info.updates[0].dateTime = DateTime.Now.ToString();
});

See the test cases for deeper examples

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SkinnyJson:

Package Downloads
BearBonesMessaging

BearBones messaging: lower-level framework, part of a contract-interface based distributed event framework for .Net

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.9 349 10/11/2024
3.0.8 86 10/11/2024
3.0.7 125 10/5/2024
3.0.6 438 8/2/2024
3.0.5 270 7/26/2024
3.0.4 59 7/26/2024
3.0.3 304 6/29/2024
3.0.2 962 6/27/2024
3.0.1 229 6/14/2024
3.0.0 115 6/13/2024
2.8.5 251 5/22/2024
2.8.4 120 5/13/2024
2.8.3 3,308 4/22/2024
2.8.2 111 4/19/2024
2.8.1 450 2/27/2024
2.8.0 775 2/8/2024
2.7.5 257 7/10/2023
2.7.0 167 7/4/2023
2.6.0 158 6/22/2023
2.5.0 178 5/19/2023
2.4.2 261 3/13/2023
2.4.1 304 12/13/2022
2.4.0 310 12/13/2022
2.3.0 283 12/12/2022
2.2.3 470 9/5/2022
2.2.2 419 9/2/2022
2.2.1 425 9/2/2022
2.1.1 4,733 5/30/2022
2.1.0 510 3/7/2022
2.0.3 481 3/4/2022
2.0.2 433 5/24/2021
2.0.1 406 5/17/2021
2.0.0 3,306 12/1/2020
1.8.0 539 11/3/2020
1.7.0 1,651 7/3/2019
1.6.9 1,623 5/22/2019
1.6.8 1,203 5/22/2019
1.6.5 4,539 1/10/2019
1.6.4 744 1/10/2019
1.6.3 2,236 12/13/2018
1.6.2 776 11/24/2018
1.6.1 791 11/23/2018
1.6.0 763 11/23/2018
1.5.5 783 11/7/2018
1.5.0 871 8/24/2018
1.4.0 897 8/24/2018
1.3.2 869 8/14/2018
1.3.1 909 8/14/2018
1.3.0 960 7/25/2018
1.2.0 900 7/23/2018
1.0.3 1,027 6/27/2018
1.0.2 1,443 8/26/2014
1.0.1 1,096 8/20/2014
1.0.0 1,105 8/20/2014

Beautify improvements