Home icon

Generate standalone types with Smithy

Developer Tools Blog



This article explains how Smithy's new shape closures feature enables generating standalone types for events published by services, eliminating the need for consumers to maintain separate event definitions.

  • Shape closures allow defining named sets of shapes explicitly in a Smithy model for code generation
  • Services can tag event structures and use selectors to include them in a closure without appearing in service operations
  • Generated types include serialization and validation code, with support in smithy-java 1.5.1 and smithy-typescript 0.52.0
  • Producers and subscribers share one generated definition, reducing errors from manual event definitions
  • Example demonstrates publishing SightingReported and SightingWithdrawn events to Amazon SNS with CBOR encoding
  • Subscribers deserialize events using the same generated types and codecs as producers

Shape closures enable consistent event modeling across services and consumers by generating types from a single source definition in the Smithy model.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Apr 2
2026
Smithy Kotlin client code generation now generally available
Nov 17
2026
Introducing Smithy IDL 2.1
Apr 6
2026
Smithy Java client framework is now generally available
Sep 3
2026
Amazon SageMaker Unified Studio Workflows support Python and Bash operators

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.