Smithy is an open source, protocol-agnostic interface definition language (IDL) and toolchain developed at AWS for defining, validating, and generating API clients, servers, and documentation for any programming language. It powers the AWS SDK code generation pipeline and supports protocol-agnostic API modeling with shapes, traits, validators, and code generators. Smithy IDL 2.0 is the current stable version.
Smithy models consist of shapes (the type system) and traits (annotations). Models can be written in the Smithy IDL syntax or represented as JSON AST. The Smithy CLI can build, validate, diff, and transform models into generated artifacts.
- AWS Protocols: restJson1, restXml, json1.0, json1.1, query, ec2Query
- Smithy Protocols: rpcv2Cbor
- Event Streaming: MQTT bindings
- smithy-shape-schema.json — Schema for a Smithy shape (all types)
- smithy-model-schema.json — Schema for a Smithy model in JSON AST format
- smithy-model-structure.json — Smithy model JSON AST structure documentation
- smithy-context.jsonld — Linked data context for Smithy model concepts
- smithy-simple-service-example.json — A simple Smithy 2.0 service model in JSON AST
- smithy-rules.yml — Spectral ruleset for Smithy-generated OpenAPI conventions
- smithy-vocabulary.yml — Normative vocabulary: shapes, traits, protocols, CLI commands
| Language | Repository |
|---|---|
| Java | smithy-lang/smithy |
| Rust | smithy-lang/smithy-rs |
| Python | smithy-lang/smithy-python |
| TypeScript | awslabs/smithy-typescript |
| Kotlin | smithy-lang/smithy-kotlin |
| Go | aws/smithy-go |