Shadow.Quack.Json
1.4.3
See the version list below for details.
Install-Package Shadow.Quack.Json -Version 1.4.3
dotnet add package Shadow.Quack.Json --version 1.4.3
<PackageReference Include="Shadow.Quack.Json" Version="1.4.3" />
paket add Shadow.Quack.Json --version 1.4.3
#r "nuget: Shadow.Quack.Json, 1.4.3"
// Install Shadow.Quack.Json as a Cake Addin
#addin nuget:?package=Shadow.Quack.Json&version=1.4.3
// Install Shadow.Quack.Json as a Cake Tool
#tool nuget:?package=Shadow.Quack.Json&version=1.4.3
Shadow Quack JSON
This package allows the easy population of values directly from a JSON string to a dynamically implemented immutable interface
with the help of the base Shadow Quack package.
This means that there is almost no effort in deserialising from JSON to an interface
with no need for concrete implementations or additional code.
public interface IJsonProxyTestInterface
{
bool Boolean { get; }
decimal DecimalNumber { get; }
int Number { get; }
IEnumerable<int> Numbers { get; }
IEnumerable<string> Strings { get; }
string Name { get; }
string Type { get; }
}
JsonProxy input = "{\"boolean\":true}";
var result = Duck.Implement<IJsonProxyTestInterface>(input);
var input = "{\"number\":1, \"decimalNumber\":1.6}";
var result = Duck.Implement<IJsonProxyTestInterface>((JsonProxy) input);
var result = Duck.Implement<IJsonProxyTestInterface>((JsonProxy) "{\"numbers\":[1,2,3,4,5]}");
JsonProxy input = "{\"name\":\"value\",\"type\":\"value2\" }";
var result = Duck.Implement<IJsonProxyTestInterface>(input);
This ability has applications within unit tests, to reduce the number of mock data objects, required, and within production code to read in/translate configuration and JSON data without the need for a class implementation.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETFramework 4.6.1
- Shadow.Quack (>= 2.0.3)
- System.Text.Json (>= 6.0.0)
-
.NETStandard 2.1
- Shadow.Quack (>= 2.0.3)
- System.Text.Json (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Shadow.Quack.Json:
Package | Downloads |
---|---|
Quack.Api
Implementation of generic JsonConverter and JsonConvertorFactory to allow the use of Interfaces in ASP .Net API calls |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.7 | 116 | 4/5/2022 |
1.4.6 | 58 | 3/23/2022 |
1.4.5 | 98 | 1/30/2022 |
1.4.4 | 83 | 1/20/2022 |
1.4.3 | 145 | 12/5/2021 |
1.4.2 | 287 | 9/11/2021 |
1.4.1 | 231 | 9/10/2021 |
1.4.0 | 235 | 6/18/2021 |
1.3.1 | 233 | 5/27/2021 |
1.3.0 | 188 | 5/24/2021 |
1.2.2 | 174 | 4/23/2021 |
1.2.1 | 231 | 4/17/2021 |
1.2.0 | 226 | 4/17/2021 |
1.1.0 | 159 | 4/14/2021 |
1.0.0 | 162 | 3/29/2021 |
Udated Dependencies