Skip to content

thomaslaich/smithy-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSmithy logo

CI Docs NuGet .NET 10 License Smithy CLI

Work in Progress: NSmithy is a proof of concept. Protocol implementations are not yet on par with the Smithy reference implementations.

NSmithy

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.

Features

  • 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, and alloy.proto#grpc.
  • Conformance-tested: Validated against official Smithy, AWS, and alloy conformance suites.

Development

The recommended way to work on this repo is with Nix and devenv.

  1. Install Nix (recommended: Determinate Nix) and devenv.

  2. Optionally install direnv to activate the dev environment automatically when entering the directory (direnv allow). Without it, run devenv shell manually.

  3. Use the just recipes 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 — 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 simpleRestJson and 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.

About

Smithy tooling for .NET

Resources

License

Stars

Watchers

Forks

Contributors