Skip to content

Commit a281163

Browse files
committed
Fix: NetJSON
1 parent 810d7e9 commit a281163

6 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/TextSerializers/JsonSerializers/Aoxe.NetJson/Aoxe.NetJson.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
5-
<PackageVersion>2025.1.2</PackageVersion>
6-
<Version>2025.1.2</Version>
5+
<PackageVersion>2025.1.3</PackageVersion>
6+
<Version>2025.1.3</Version>
77
<Description>The wrappers and extensions methods base by NetJSON</Description>
88
<PackageTags>Aoxe;Json;Json.NET;NetJSON;serialize;deserialize</PackageTags>
99
<PackageProjectUrl>https://github.com/AoxeTech</PackageProjectUrl>
@@ -28,7 +28,7 @@
2828
<PrivateAssets>all</PrivateAssets>
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
</PackageReference>
31-
<PackageReference Include="NetJSON" Version="1.4.4" />
31+
<PackageReference Include="NetJSON" Version="1.4.5" />
3232
<PackageReference Include="Aoxe.Extensions" Version="2025.3.0" />
3333
<PackageReference Include="Aoxe.Serializer.Abstractions" Version="2025.1.0" />
3434
</ItemGroup>

src/TextSerializers/JsonSerializers/Aoxe.NetJson/NetJson.Helper.Bytes.FromBytes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ bytes is null || bytes.Length is 0
2323
/// <returns></returns>
2424
public static object? FromBytes(Type type, byte[]? bytes, NetJSONSettings? settings = null) =>
2525
bytes is null || bytes.Length is 0
26-
? default
26+
? null
2727
: FromJson(type, bytes.GetStringByUtf8(), settings);
2828
}

src/TextSerializers/JsonSerializers/Aoxe.NetJson/NetJson.Helper.Stream.FromStream.Async.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ await stream.ReadStringAsync(cancellationToken: cancellationToken),
4545
)
4646
{
4747
if (stream is null or { CanSeek: true, Length: 0 })
48-
return default;
48+
return null;
4949
var result = FromJson(
5050
type,
5151
await stream.ReadStringAsync(cancellationToken: cancellationToken),

src/TextSerializers/JsonSerializers/Aoxe.NetJson/NetJson.Helper.Stream.FromStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static partial class NetJsonHelper
3030
public static object? FromStream(Type type, Stream? stream, NetJSONSettings? settings = null)
3131
{
3232
if (stream is null or { CanSeek: true, Length: 0 })
33-
return default;
33+
return null;
3434
var result = FromJson(type, stream.ReadString(), settings);
3535
stream.TrySeek(0, SeekOrigin.Begin);
3636
return result;

src/TextSerializers/JsonSerializers/Aoxe.NetJson/NetJson.Helper.String.FromJson.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static partial class NetJsonHelper
1010
/// <typeparam name="TValue"></typeparam>
1111
/// <returns></returns>
1212
public static TValue? FromJson<TValue>(string? json, NetJSONSettings? settings = null) =>
13-
string.IsNullOrWhiteSpace(json) || json is "null"
13+
string.IsNullOrWhiteSpace(json)
1414
? default
1515
: NetJSON
1616
.NetJSON
@@ -24,7 +24,7 @@ public static partial class NetJsonHelper
2424
/// <param name="settings"></param>
2525
/// <returns></returns>
2626
public static object? FromJson(Type type, string? json, NetJSONSettings? settings = null) =>
27-
string.IsNullOrWhiteSpace(json) || json is "null"
28-
? default
27+
string.IsNullOrWhiteSpace(json)
28+
? null
2929
: NetJSON.NetJSON.Deserialize(type, json, settings ?? NetJSONSettings.CurrentSettings);
3030
}

src/TextSerializers/JsonSerializers/Aoxe.NetJson/NetJson.Helper.String.ToJson.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ public static string ToJson<TValue>(TValue? value, NetJSONSettings? settings = n
1919
/// <param name="settings"></param>
2020
/// <returns></returns>
2121
public static string ToJson(object? value, NetJSONSettings? settings = null) =>
22-
value is null
23-
? "null"
24-
: NetJSON.NetJSON.SerializeObject(value, settings ?? NetJSONSettings.CurrentSettings);
22+
NetJSON.NetJSON.SerializeObject(value, settings ?? NetJSONSettings.CurrentSettings);
2523

2624
/// <summary>
2725
/// Serialize the value to json string.

0 commit comments

Comments
 (0)