Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docfx/Dockerfile.docfx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NGINX_VERSION=1.31.2-alpine
ARG NGINX_VERSION=1.31-alpine

FROM --platform=$BUILDPLATFORM nginx:${NGINX_VERSION} AS base
RUN rm -rf /usr/share/nginx/html/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 10.1.6
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 10.1.5
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 10.1.6
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 10.1.5
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 10.1.6
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 10.1.5
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 10.1.6
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 10.1.5
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ For more details, please refer to `PackageReleaseNotes.txt` on a per assembly ba
> [!NOTE]
> Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Newtonsoft.Json, Cuemon.Extensions.AspNetCore.Newtonsoft.Json and Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.

## [10.1.6] - 2026-07-23

This is a patch release focused on dependency service updates, tighter source-project build analysis, and maintainability cleanups around ExceptionConverter and modern C# patterns.

### Changed

- Package dependencies upgraded:
- Codebelt.Extensions.Xunit (11.1.1 → 11.1.2),
- Codebelt.Extensions.Xunit.App (11.1.1 → 11.1.2),
- Cuemon.AspNetCore.Mvc (10.5.4 → 10.5.5),
- Cuemon.Core (10.5.4 → 10.5.5),
- Cuemon.Extensions.AspNetCore (10.5.4 → 10.5.5),
- Cuemon.Extensions.AspNetCore.Authentication (10.5.4 → 10.5.5),
- Cuemon.Extensions.AspNetCore.Mvc (10.5.4 → 10.5.5),
- Cuemon.Extensions.Core (10.5.4 → 10.5.5),
- Cuemon.Extensions.IO (10.5.4 → 10.5.5),
- Cuemon.IO (10.5.4 → 10.5.5),
- Microsoft.NET.Test.Sdk (18.7.0 → 18.8.1),
- Directory.Build.props now scopes multi-targeting, packaging, and signing to source projects, enables recommended analyzers with style enforcement, and sets MinVerTagPrefix,
- ExceptionConverter JSON parse path extracted into focused helpers, removing the legacy GlobalSuppressions file that only covered the old monolithic parser,
- Source and tests modernized to prefer using declarations and ThrowIfNull on supported TFMs, with a direct char compare for trailing-asterisk path matching in JDataResultExtensions,
- XML cref documentation simplified by dropping redundant `T:` prefixes on generic type references,
- DocFX nginx base image pin loosened from `1.31.2-alpine` to `1.31-alpine`.

## [10.1.5] - 2026-06-30

This is a patch release focused on complete DocFX documentation publishing, agent guidance improvements, package version updates, and CI/CD robustness.
Expand Down Expand Up @@ -286,7 +310,7 @@ This major release is first and foremost focused on ironing out any wrinkles tha
- JsonReaderResultExtensions class from the Codebelt.Extensions.Newtonsoft.Json namespace
- JsonReaderParser class from the Codebelt.Extensions.Newtonsoft.Json namespace

[Unreleased]: https://github.com/codebeltnet/newtonsoft-json/compare/v10.1.5...HEAD
[10.1.6]: https://github.com/codebeltnet/newtonsoft-json/compare/v10.1.5...v10.1.6
[10.1.5]: https://github.com/codebeltnet/newtonsoft-json/compare/v10.1.4...v10.1.5
[10.1.4]: https://github.com/codebeltnet/newtonsoft-json/compare/v10.1.3...v10.1.4
[10.1.3]: https://github.com/codebeltnet/newtonsoft-json/compare/v10.1.2...v10.1.3
Expand Down
13 changes: 10 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<PropertyGroup>
<IsTestProject>$(MSBuildProjectName.EndsWith('Tests'))</IsTestProject>
<IsBenchmarkProject>$(MSBuildProjectName.EndsWith('Benchmarks'))</IsBenchmarkProject>
<IsSourceProject>$(MSBuildProjectDirectory.ToLower().StartsWith('$(MSBuildThisFileDirectory.ToLower())src'))</IsSourceProject>
<IsToolingProject>$(MSBuildProjectDirectory.ToLower().StartsWith('$(MSBuildThisFileDirectory.ToLower())tooling'))</IsToolingProject>
<IsLinux>$([MSBuild]::IsOSPlatform('Linux'))</IsLinux>
<IsMacOS>$([MSBuild]::IsOSPlatform('OSX'))</IsMacOS>
<IsWindows>$([MSBuild]::IsOSPlatform('Windows'))</IsWindows>
Expand All @@ -16,7 +19,7 @@
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'false'">
<PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
<TargetFrameworks>net10.0;net9.0;netstandard2.0</TargetFrameworks>
<Copyright>Copyright © Geekle 2024-2026. All rights reserved.</Copyright>
<Authors>gimlichael</Authors>
Expand All @@ -36,7 +39,11 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SignAssembly Condition="('$(CI)' == 'true' OR '$(IsMainAuthor)' == 'true') AND '$(SkipSignAssembly)' == 'false'">true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)newtonsoft.snk</AssemblyOriginatorKeyFile>
<NoWarn>7035,CA2260</NoWarn>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>Recommended</AnalysisMode>
<NoWarn>7035,CA2260,S6618</NoWarn>
<MinVerTagPrefix>v</MinVerTagPrefix>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup Condition="'$(NuGetPackageRoot)' != ''">
Expand Down Expand Up @@ -65,7 +72,7 @@
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
<SonarQubeExclude>true</SonarQubeExclude>
<WarningLevel>0</WarningLevel>
<AnalysisLevel>none</AnalysisLevel>
<AnalysisMode>none</AnalysisMode>
<NoWarn>NU1701,NETSDK1206</NoWarn>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
Expand Down
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Codebelt.Extensions.Xunit" Version="11.1.1" />
<PackageVersion Include="Codebelt.Extensions.Xunit.App" Version="11.1.1" />
<PackageVersion Include="Cuemon.AspNetCore.Mvc" Version="10.5.4" />
<PackageVersion Include="Cuemon.Core" Version="10.5.4" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore" Version="10.5.4" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore.Authentication" Version="10.5.4" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore.Mvc" Version="10.5.4" />
<PackageVersion Include="Cuemon.Extensions.Core" Version="10.5.4" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="10.5.4" />
<PackageVersion Include="Cuemon.IO" Version="10.5.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageVersion Include="Codebelt.Extensions.Xunit" Version="11.1.2" />
<PackageVersion Include="Codebelt.Extensions.Xunit.App" Version="11.1.2" />
<PackageVersion Include="Cuemon.AspNetCore.Mvc" Version="10.5.5" />
<PackageVersion Include="Cuemon.Core" Version="10.5.5" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore" Version="10.5.5" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore.Authentication" Version="10.5.5" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore.Mvc" Version="10.5.5" />
<PackageVersion Include="Cuemon.Extensions.Core" Version="10.5.5" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="10.5.5" />
<PackageVersion Include="Cuemon.IO" Version="10.5.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageVersion Include="MinVer" Version="7.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class JsonConverterCollectionExtensions
/// <summary>
/// Adds a <see cref="ProblemDetails"/> JSON converter to the list.
/// </summary>
/// <param name="converters">The <see cref="T:ICollection{JsonConverter}" /> to extend.</param>
/// <param name="converters">The <see cref="ICollection{JsonConverter}" /> to extend.</param>
/// <returns>A reference to <paramref name="converters"/> after the operation has completed.</returns>
public static ICollection<JsonConverter> AddProblemDetailsConverter(this ICollection<JsonConverter> converters)
{
Expand Down Expand Up @@ -74,7 +74,7 @@ private static void WriteProblemDetails(JsonWriter writer, ProblemDetails pd, Js
/// <summary>
/// Adds an <see cref="HttpExceptionDescriptor"/> JSON converter to the list.
/// </summary>
/// <param name="converters">The <see cref="T:ICollection{JsonConverter}" /> to extend.</param>
/// <param name="converters">The <see cref="ICollection{JsonConverter}" /> to extend.</param>
/// <param name="setup">The <see cref="ExceptionDescriptorOptions"/> which may be configured.</param>
/// <returns>A reference to <paramref name="converters"/> after the operation has completed.</returns>
public static ICollection<JsonConverter> AddHttpExceptionDescriptorConverter(this ICollection<JsonConverter> converters, Action<ExceptionDescriptorOptions> setup = null)
Expand Down Expand Up @@ -112,7 +112,7 @@ public static ICollection<JsonConverter> AddHttpExceptionDescriptorConverter(thi
/// <summary>
/// Adds an <see cref="StringValues"/> JSON converter to the list.
/// </summary>
/// <param name="converters">The <see cref="T:ICollection{JsonConverter}" /> to extend.</param>
/// <param name="converters">The <see cref="ICollection{JsonConverter}" /> to extend.</param>
/// <returns>A reference to <paramref name="converters"/> after the operation has completed.</returns>
public static ICollection<JsonConverter> AddStringValuesConverter(this ICollection<JsonConverter> converters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ExceptionConverter(bool includeStackTrace = false, bool includeData = fal
/// <summary>
/// Writes the JSON representation of the object.
/// </summary>
/// <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter" /> to write to.</param>
/// <param name="writer">The <see cref="JsonWriter" /> to write to.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The calling serializer.</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Expand All @@ -53,7 +53,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
/// <summary>
/// Reads the JSON representation of the object.
/// </summary>
/// <param name="reader">The <see cref="T:Newtonsoft.Json.JsonReader" /> to read from.</param>
/// <param name="reader">The <see cref="JsonReader" /> to read from.</param>
/// <param name="objectType">Type of the object.</param>
/// <param name="existingValue">The existing value of object being read.</param>
/// <param name="serializer">The calling serializer.</param>
Expand All @@ -72,53 +72,61 @@ private static Stack<IList<MemberArgument>> ParseJsonReader(JsonReader reader, T
var blueprints = new List<MemberArgument>();
while (reader.Read())
{
if (reader.Depth != lastDepth && blueprints.Count > 0)
if (ShouldPushBlueprints(reader, lastDepth, blueprints))
{
stack.Push(blueprints);
blueprints = new List<MemberArgument>();
}

switch (reader.TokenType)
{
case JsonToken.PropertyName:
string memberName = MapOrDefault(reader.Value!.ToString()!);
if (!reader.Read())
{
// throw
}
var property = properties.SingleOrDefault(pi => pi.Name.Equals(memberName, StringComparison.OrdinalIgnoreCase));
if (property != null)
{
if (property.Name == nameof(Exception.InnerException))
{
blueprints.Add(new MemberArgument(memberName, null));
}
else
{
blueprints.Add(new MemberArgument(memberName, reader.Value));
}
}
else
{
if (memberName.Equals("type", StringComparison.OrdinalIgnoreCase))
{
objectType = Formatter.GetType(reader.Value.ToString());
properties = objectType.GetProperties(MemberReflection.CreateFlags(o => o.ExcludeStatic = true)).ToList();
blueprints.Add(new MemberArgument(memberName, objectType));
}
}
break;
case JsonToken.Comment:
break;
case JsonToken.EndObject:
break;
}
HandleToken(reader, ref objectType, ref properties, blueprints);
lastDepth = reader.Depth;
}

return stack;
}

private static bool ShouldPushBlueprints(JsonReader reader, int lastDepth, List<MemberArgument> blueprints)
{
return reader.Depth != lastDepth && blueprints.Count > 0;
}

private static void HandleToken(JsonReader reader, ref Type objectType, ref List<PropertyInfo> properties, List<MemberArgument> blueprints)
{
if (reader.TokenType != JsonToken.PropertyName) { return; }
HandlePropertyName(reader, ref objectType, ref properties, blueprints);
}

private static void HandlePropertyName(JsonReader reader, ref Type objectType, ref List<PropertyInfo> properties, List<MemberArgument> blueprints)
{
var memberName = MapOrDefault(reader.Value!.ToString()!);
if (!reader.Read()) { return; }

var property = properties.SingleOrDefault(pi => pi.Name.Equals(memberName, StringComparison.OrdinalIgnoreCase));
if (property == null)
{
HandleTypeMember(reader, memberName, ref objectType, ref properties, blueprints);
return;
}

blueprints.Add(CreateMemberArgument(reader, memberName, property));
}

private static void HandleTypeMember(JsonReader reader, string memberName, ref Type objectType, ref List<PropertyInfo> properties, List<MemberArgument> blueprints)
{
if (!memberName.Equals("type", StringComparison.OrdinalIgnoreCase)) { return; }

objectType = Formatter.GetType(reader.Value.ToString());
properties = objectType.GetProperties(MemberReflection.CreateFlags(o => o.ExcludeStatic = true)).ToList();
blueprints.Add(new MemberArgument(memberName, objectType));
}

private static MemberArgument CreateMemberArgument(JsonReader reader, string memberName, PropertyInfo property)
{
return property.Name == nameof(Exception.InnerException)
? new MemberArgument(memberName, null)
: new MemberArgument(memberName, reader.Value);
}

private static string MapOrDefault(string memberName)
{
switch (memberName.ToLowerInvariant())
Expand Down
Loading
Loading