NSmithy.Core 0.22.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NSmithy.Core --version 0.22.0
                    
NuGet\Install-Package NSmithy.Core -Version 0.22.0
                    
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="NSmithy.Core" Version="0.22.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NSmithy.Core" Version="0.22.0" />
                    
Directory.Packages.props
<PackageReference Include="NSmithy.Core" />
                    
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 NSmithy.Core --version 0.22.0
                    
#r "nuget: NSmithy.Core, 0.22.0"
                    
#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 NSmithy.Core@0.22.0
                    
#: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=NSmithy.Core&version=0.22.0
                    
Install as a Cake Addin
#tool nuget:?package=NSmithy.Core&version=0.22.0
                    
Install as a Cake Tool

NSmithy

CI Docs NuGet .NET 10 License Smithy CLI

Docs · Quick start · Examples · Design docs · Changelog

NSmithy generates clients, ASP.NET Core servers, and model types in C# and F# from Smithy models as part of dotnet build. There is no separate codegen step, and a client and server generated from the same model agree on routes, serialization, and errors.

Preview: expect some API changes before 1.0.

Example

A model:

@restJson1
service HelloService {
    version: "2006-03-01"
    operations: [SayHello]
}

@readonly
@http(method: "GET", uri: "/hello/{name}")
operation SayHello {
    input := {
        @required
        @httpLabel
        name: String
    }
    output := {
        @required
        message: String
    }
}

A server implements the generated handler interface and maps the generated routes:

builder.Services.AddHelloServiceHandler<HelloHandler>();
app.MapHelloService();

sealed class HelloHandler : IHelloServiceHandler
{
    public Task<SayHelloOutput> SayHelloAsync(
        SayHelloInput input,
        CancellationToken cancellationToken = default
    ) => Task.FromResult(new SayHelloOutput($"Hello, {input.Name}!"));
}

A client calls it:

var client = new HelloServiceClient(new Uri("http://localhost:5000"));
var response = await client.SayHelloAsync(new SayHelloInput("world"));

Add an operation to the model and the server stops compiling until it is handled.

Quick start

With the .NET 10 SDK installed:

dotnet new install NSmithy.Templates
dotnet new nsmithy-contracts -n HelloWorld.Contracts --smithy-cli-package
dotnet new nsmithy-server -n HelloWorld.Server --contracts-project HelloWorld.Contracts --smithy-cli-package
dotnet run --project HelloWorld.Server
curl http://localhost:5000/hello/world

--smithy-cli-package gets the Smithy CLI and its Java runtime from NuGet. Omit it to use a Smithy CLI on your PATH. The quick start adds a client and walks through the generated code.

Features

Contributing

See CONTRIBUTING.md for the development environment and build recipes.

  • Smithy, the IDL NSmithy is built on.
  • smithy4s, the main inspiration for NSmithy.
  • alloy, used for simpleRestJson and gRPC.
  • smithy-go and smithy-typescript, the official generators for Go and TypeScript.
  • TypeSpec, Microsoft's alternative with first-party .NET emitters.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on NSmithy.Core:

Package Downloads
NSmithy.Http

HTTP transport, protocol abstractions, and modeled error handling shared by NSmithy clients and servers.

NSmithy.Codecs.Json

JSON serializer and deserializer for Smithy shapes, used by NSmithy JSON protocols.

NSmithy.Codecs.Xml

XML serializer and deserializer for Smithy shapes, used by NSmithy AWS XML protocols.

NSmithy.Codecs.Cbor

CBOR serializer and deserializer for Smithy shapes, used by the NSmithy rpcv2Cbor protocol.

NSmithy.Protocols.Rest

Smithy HTTP binding support (routes, headers, query strings, status codes) shared by NSmithy REST protocols.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.0 307 11/22/2026
0.22.0 290 11/21/2026
0.21.0 286 11/20/2026
0.20.1 311 11/15/2026
0.20.0 292 11/15/2026
0.19.0 290 11/8/2026
0.18.2 285 11/8/2026
0.18.1 289 11/7/2026
0.18.0 332 11/4/2026
0.17.0 291 11/2/2026
0.16.0 301 11/1/2026
0.15.1 306 10/29/2026
0.15.0 287 10/28/2026
0.14.0 318 10/25/2026
0.13.0 264 10/16/2026
0.12.0 241 10/11/2026
0.11.0 253 10/8/2026
0.10.1 251 10/2/2026
0.10.0 288 9/7/2026
0.9.0 273 8/25/2026
Loading failed