Regira.Serializing.Newtonsoft
6.1.2
dotnet add package Regira.Serializing.Newtonsoft --version 6.1.2
NuGet\Install-Package Regira.Serializing.Newtonsoft -Version 6.1.2
<PackageReference Include="Regira.Serializing.Newtonsoft" Version="6.1.2" />
<PackageVersion Include="Regira.Serializing.Newtonsoft" Version="6.1.2" />
<PackageReference Include="Regira.Serializing.Newtonsoft" />
paket add Regira.Serializing.Newtonsoft --version 6.1.2
#r "nuget: Regira.Serializing.Newtonsoft, 6.1.2"
#:package Regira.Serializing.Newtonsoft@6.1.2
#addin nuget:?package=Regira.Serializing.Newtonsoft&version=6.1.2
#tool nuget:?package=Regira.Serializing.Newtonsoft&version=6.1.2
Regira Serializing
Regira Serializing provides JSON serialisation via the ISerializer contract defined in Common.
Projects
| Project | Package | Backend |
|---|---|---|
Serializing.Newtonsoft |
Regira.Serializing.Newtonsoft |
Newtonsoft.Json |
Installation
<PackageReference Include="Regira.Serializing.Newtonsoft" Version="6.*" />
JsonSerializer
Implements ISerializer. Registers as a singleton in most consuming projects.
ISerializer json = new Regira.Serializing.Newtonsoft.Json.JsonSerializer();
string s = json.Serialize(myObject);
MyType obj = json.Deserialize<MyType>(s)!;
object dyn = json.Deserialize(s, typeof(MyType))!;
Options
| Property | Type | Default | Description |
|---|---|---|---|
EnumAsString |
bool |
true |
Serialise enums as their name, not integer |
BoolAsNumber |
bool |
true |
Serialise bool as 1/0 |
IgnoreNullValues |
bool |
true |
Omit null properties |
WriteIndented |
bool |
false |
Pretty-print JSON |
ISerializer json = new JsonSerializer(new JsonSerializer.Options
{
EnumAsString = true,
WriteIndented = true
});
Built-in converters
| Converter | Handles | Registered |
|---|---|---|
StringEnumConverter |
enum ↔ name | when EnumAsString is true |
BoolNumberConverter |
bool ↔ 0/1 |
when BoolAsNumber is true |
DateOnlyJsonConverter |
DateOnly |
always |
DateAndTimeConverter |
DateTime / DateTimeOffset |
always |
Independent of converters, the serializer always uses camelCase property naming (contract resolver) and ignores reference loops (ReferenceLoopHandling.Ignore).
DI Registration
services.AddSingleton<ISerializer, Regira.Serializing.Newtonsoft.Json.JsonSerializer>();
License
Apache License 2.0 — this package contains no license validation and no runtime limits. See LICENSE. A few companion packages are commercially licensed with a free tier; see the licensing overview.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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. |
-
net10.0
- Newtonsoft.Json (>= 13.0.4)
- Regira.Common (>= 6.1.2)
-
net8.0
- Newtonsoft.Json (>= 13.0.4)
- Regira.Common (>= 6.1.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Regira.Serializing.Newtonsoft:
| Package | Downloads |
|---|---|
|
Regira.Invoicing.Billit
Billit API integration for invoicing in Regira. |
GitHub repositories
This package is not used by any popular GitHub repositories.