NSmithy.Server.AspNetCore.Docs
0.7.0
dotnet add package NSmithy.Server.AspNetCore.Docs --version 0.7.0
NuGet\Install-Package NSmithy.Server.AspNetCore.Docs -Version 0.7.0
<PackageReference Include="NSmithy.Server.AspNetCore.Docs" Version="0.7.0" />
<PackageVersion Include="NSmithy.Server.AspNetCore.Docs" Version="0.7.0" />
<PackageReference Include="NSmithy.Server.AspNetCore.Docs" />
paket add NSmithy.Server.AspNetCore.Docs --version 0.7.0
#r "nuget: NSmithy.Server.AspNetCore.Docs, 0.7.0"
#:package NSmithy.Server.AspNetCore.Docs@0.7.0
#addin nuget:?package=NSmithy.Server.AspNetCore.Docs&version=0.7.0
#tool nuget:?package=NSmithy.Server.AspNetCore.Docs&version=0.7.0
Preview: NSmithy is in preview; expect some API changes before 1.0. Protocol implementations are not yet on par with the Smithy reference implementations.
NSmithy
Docs · Examples · Design Docs · smithy.io
NSmithy is a .NET toolkit that turns a Smithy model into idiomatic C# at build time.
Features
- Contract-first: The Smithy model is the source of truth. NSmithy generates C# model types, clients, and ASP.NET Core server stubs from it.
- Protocol-agnostic: The same model can target multiple protocols; switching protocols requires no changes to client or server code.
- Part of the Smithy ecosystem: A .NET service built with NSmithy can be called from clients generated for Java, TypeScript, Python, Go, Rust, Swift, and more, and vice versa.
- Protocol support: REST JSON, REST XML, AWS JSON, RPC v2 CBOR, and native gRPC.
- Streaming support: Event streaming, bidirectional streaming, and streaming blob payloads.
- Smithy-native architecture: Follows Smithy's official code generator guidance.
- Conformance-tested: Tested against official Smithy, AWS, and alloy conformance suites.
Quick Start
Install the templates and scaffold a contracts project, a server, and a client:
dotnet new install NSmithy.Templates
# A contracts project owns the Smithy model
dotnet new nsmithy-contracts -n HelloWorld.Contracts
# A server that implements the model's handler…
dotnet new nsmithy-server -n HelloWorld.Server --contracts HelloWorld.Contracts
# …and a typed client that calls it
dotnet new nsmithy-client -n HelloWorld.Client
The starter model is a single restJson1 operation; dotnet build runs codegen
and produces the model types, IHelloServiceHandler interface, and typed
HelloServiceClient. Implement the handler, and call the client:
// Server: implement the generated handler
internal sealed class HelloHandler : IHelloServiceHandler
{
public Task<SayHelloOutput> SayHelloAsync(SayHelloInput input, CancellationToken ct = default) =>
Task.FromResult(new SayHelloOutput($"Hello, {input.Name}!"));
}
// Client: call the typed client
var client = new HelloServiceClient(new Uri("http://localhost:5000"));
var response = await client.SayHelloAsync(new SayHelloInput("world"));
Console.WriteLine(response.Message); // Hello, world!
See the Quick Start guide for the full walkthrough.
Development
The recommended way to work on this repo is with Nix and devenv.
Install Nix (recommended: Determinate Nix) and devenv.
Optionally install direnv to activate the dev environment automatically when entering the directory (
direnv allow). Without it, rundevenv shellmanually.Use the
justrecipes to build, test, and package:just # list all available recipes just build # build the codegen JAR and .NET solution just test # run the test suite just fmt # format all code just docs # start the documentation dev server just ci # run the full CI pipeline locally
Related Projects
- Smithy: The IDL and protocol framework NSmithy is built on.
- smithy4s: Scala codegen from Smithy models and the main inspiration for NSmithy.
- alloy: Smithy extensions used by NSmithy for
simpleRestJsonand gRPC. - smithy-go / smithy-typescript: Official Smithy codegen plugins for Go and TypeScript.
- TypeSpec: Microsoft's alternative API description language, with first-party .NET emitters.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Scalar.AspNetCore (>= 2.11.3)
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 |
|---|---|---|
| 0.7.0 | 31 | 7/30/2026 |
| 0.6.0 | 181 | 7/10/2026 |
| 0.5.0 | 88 | 7/9/2026 |
| 0.4.0 | 96 | 7/1/2026 |
| 0.3.0 | 108 | 6/21/2026 |
| 0.2.0 | 108 | 6/16/2026 |
| 0.1.0 | 110 | 6/8/2026 |
| 0.1.0-preview.15 | 53 | 5/28/2026 |
| 0.1.0-preview.14 | 60 | 5/28/2026 |
| 0.1.0-preview.13 | 49 | 5/28/2026 |
| 0.1.0-preview.12 | 53 | 5/27/2026 |