VOOZH about

URL: https://www.nuget.org/packages/Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json/

⇱ NuGet Gallery | Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json 1.0.4




👁 Image
Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json 1.0.4

dotnet add package Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json --version 1.0.4
 
 
NuGet\Install-Package Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json -Version 1.0.4
 
 
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="Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json" Version="1.0.4" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json" Version="1.0.4" />
 
Directory.Packages.props
<PackageReference Include="Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json --version 1.0.4
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json, 1.0.4"
 
 
#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.
#:package Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json@1.0.4
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json&version=1.0.4
 
Install as a Cake Addin
#tool nuget:?package=Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json&version=1.0.4
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json

A Newtonsoft.Json-powered response negotiator for Carter in ASP.NET Core minimal APIs.

About

Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json extends the Codebelt.Extensions.Carter package with a dedicated JSON response negotiator for Carter, capable of serializing response models to JSON format using Newtonsoft.Json.

This package is useful when you need Newtonsoft.Json-specific behavior (for example custom converters, contract resolvers, or legacy JSON compatibility) while keeping Carter modules and content negotiation straightforward.

CSharp Example

Functional-test style sample (same bootstrapping pattern used by this repository):

using System.Net.Http.Headers;
using System.Threading.Tasks;
using Carter;
using Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Formatters;
using Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json;
using Codebelt.Extensions.Carter.Assets;
using Codebelt.Extensions.Xunit.Hosting.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;

using var response = await MinimalWebHostTestFactory.RunAsync(
 services =>
 {
 services.AddNewtonsoftJsonFormatterOptions(o =>
 {
 o.Settings.Converters.Insert(0, new StringEnumConverter(new DefaultNamingStrategy(), false));
 });
 services.AddCarter(configurator: c => c
 .WithModule<WorldModule>()
 .WithResponseNegotiator<NewtonsoftJsonNegotiator>());
 services.AddRouting();
 },
 app =>
 {
 app.UseRouting();
 app.UseEndpoints(endpoints => endpoints.MapCarter());
 },
 _ => { },
 async client =>
 {
 client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 return await client.GetAsync("/world/statistical-regions");
 });

Program-style usage for production apps (remember to inherit from ICarterModule for your endpoints and add other services as needed):

using Carter;
using Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Formatters;
using Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNewtonsoftJsonFormatterOptions();
builder.Services.AddCarter(c => c
 .WithResponseNegotiator<NewtonsoftJsonNegotiator>());

var app = builder.Build();
app.MapCarter();
app.Run();

Related Packages

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 97 6/6/2026
1.0.3 101 5/23/2026
1.0.2 116 4/17/2026
1.0.1 118 3/25/2026
1.0.0 115 3/1/2026

Version: 1.0.4
Availability: .NET 10

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

Version: 1.0.3
Availability: .NET 10

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

Version: 1.0.2
Availability: .NET 10

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

Version: 1.0.1
Availability: .NET 10

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

Version: 1.0.0
Availability: .NET 10

# New Features
- ADDED NewtonsoftJsonNegotiator class in the Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json namespace that provides a JSON response negotiator for Carter, capable of serializing response models to JSON format using Newtonsoft.Json