https://github.com/codebeltnet/carter
This library provides an opinionated and uniform way of extending Minimal APIs with content negotiation using Carter.
https://github.com/codebeltnet/carter
Last synced: about 1 month ago
JSON representation
This library provides an opinionated and uniform way of extending Minimal APIs with content negotiation using Carter.
- Host: GitHub
- URL: https://github.com/codebeltnet/carter
- Owner: codebeltnet
- License: mit
- Created: 2026-02-27T00:45:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-17T23:01:11.000Z (2 months ago)
- Last Synced: 2026-04-18T00:35:16.321Z (2 months ago)
- Language: C#
- Size: 81.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

# Extensions for Carter API by Codebelt
[](https://github.com/codebeltnet/carter/actions/workflows/ci-pipeline.yml)[](https://codecov.io/gh/codebeltnet/carter) [](https://sonarcloud.io/dashboard?id=codebelt-carter) [](https://sonarcloud.io/dashboard?id=codebelt-carter) [](https://sonarcloud.io/dashboard?id=codebelt-carter) [](https://sonarcloud.io/dashboard?id=codebelt-carter) [](https://scorecard.dev/viewer/?uri=github.com/codebeltnet/carter)
An open-source project (MIT license) that targets and complements the [Carter](https://github.com/dotnet/Carter) API library. It provides a uniform and convenient way of doing API development for all project types in .NET.
Your versatile Carter companion for modern development with `.NET 10`.
It is, by heart, free, flexible and built to extend and boost your agile codebelt.
## Concept
The Extensions for Carter API by Codebelt is designed to bring clarity, structure, and consistency to Carter projects. It provides a focused extension layer for Carter with configurable response negotiation primitives and endpoint metadata helpers for ASP.NET Core minimal APIs.
### Codebelt.Extensions.Carter Negotiator Examples
These are the standalone response negotiator packages that extend the core `Codebelt.Extensions.Carter` package with specific content negotiation capabilities:
#### Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json
```csharp
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());
var app = builder.Build();
app.MapCarter();
app.Run();
```
#### Codebelt.Extensions.Carter.AspNetCore.Text.Json
```csharp
using Carter;
using Codebelt.Extensions.Carter.AspNetCore.Text.Json;
using Cuemon.Extensions.AspNetCore.Text.Json;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalJsonOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator());
var app = builder.Build();
app.MapCarter();
app.Run();
```
#### Codebelt.Extensions.Carter.AspNetCore.Text.Yaml
```csharp
using Carter;
using Codebelt.Extensions.AspNetCore.Text.Yaml.Formatters;
using Codebelt.Extensions.Carter.AspNetCore.Text.Yaml;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalYamlOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator());
var app = builder.Build();
app.MapCarter();
app.Run();
```
#### Codebelt.Extensions.Carter.AspNetCore.Xml
```csharp
using Carter;
using Codebelt.Extensions.Carter.AspNetCore.Xml;
using Cuemon.Extensions.AspNetCore.Xml;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalXmlOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator());
var app = builder.Build();
app.MapCarter();
app.Run();
```
## 📚 Documentation
Full documentation (generated by [DocFx](https://github.com/dotnet/docfx)) located here: https://carter.codebelt.net/
## 📦 Standalone Packages
Provides a focused API for BenchmarkDotNet projects.
|Package|vNext|Stable|Downloads|
|:--|:-:|:-:|:-:|
| [Codebelt.Extensions.Carter](https://www.nuget.org/packages/Codebelt.Extensions.Carter/) |  |  |  |
| [Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json](https://www.nuget.org/packages/Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json/) |  |  |  |
| [Codebelt.Extensions.Carter.AspNetCore.Text.Json](https://www.nuget.org/packages/Codebelt.Extensions.Carter.AspNetCore.Text.Json/) |  |  |  |
| [Codebelt.Extensions.Carter.AspNetCore.Text.Yaml](https://www.nuget.org/packages/Codebelt.Extensions.Carter.AspNetCore.Text.Yaml/) |  |  |  |
| [Codebelt.Extensions.Carter.AspNetCore.Xml](https://www.nuget.org/packages/Codebelt.Extensions.Carter.AspNetCore.Xml/) |  |  |  |
### Contributing to `Extensions for Carter API by Codebelt`
[Contributions](.github/CONTRIBUTING.md) are welcome and appreciated.
Feel free to submit issues, feature requests, or pull requests to help improve this library.
### License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.