Work in Progress: NSmithy is a proof of concept. Protocol implementations are not yet on par with the Smithy reference implementations.
Docs · Design Docs · smithy.io
NSmithy is a preview-stage .NET toolkit that turns a Smithy model into idiomatic C# at build time. From a single contract you get typed clients, server scaffolding, and shared model types — fully integrated into your MSBuild workflow.
- MSBuild integration: Generate C# models, typed clients, and ASP.NET Core server stubs from a Smithy IDL as part of
dotnet build— no separate codegen step, no Java or JRE installation required. - Protocol support: Implements
alloy#simpleRestJson,aws.protocols#restJson1,aws.protocols#restXml,smithy.protocols#rpcv2Cbor, andalloy.proto#grpc. - Conformance-tested: Validated against official Smithy, AWS, and alloy conformance suites.
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
- Smithy — the IDL and protocol framework NSmithy is built on.
- smithy4s — the main inspiration for NSmithy; generates Scala code from Smithy models with similar goals, though with a more sophisticated typeclass-based codec architecture that cleanly separates schema interpretation from serialization.
- alloy — Smithy extensions used by NSmithy for
simpleRestJsonand gRPC protocols. - smithy-go / smithy-typescript — official Smithy codegen plugins for Go and TypeScript, which NSmithy draws inspiration from.
- TypeSpec — Microsoft's alternative API description language with similar goals. Compiles to OpenAPI, JSON Schema, Protobuf, and more; has first-party .NET emitters.
