Smithy export with traits, HTTP bindings and a JSON AST
Exporting an item to Smithy now writes a Smithy 2.0 model that smithy validate accepts. You
can export from OpenAPI, Protobuf, GraphQL, Thrift or any other typed or service-bearing source.
How the Smithy is written.
- IDL, JSON AST or both. The new output option writes
<Name>.smithy, the Smithy JSON AST (<Name>.json), or both. - Constraints as traits. Nullability becomes
@required, defaults@default, and constraints@length,@range,@patternand@uniqueItems. - HTTP bindings. REST operations keep their method, path and status as
@http, with labels, query parameters, headers and payloads bound. A type returned only as an error becomes an@errorstructure. - Exact fidelity report. The report lists each constraint, default, parameter, body, error and
route that Smithy cannot carry, on the construct it concerns. Constraints that become traits and
HTTP operations that keep
@httpare no longer reported as lost. - Protocol traits. The new protocol option marks each service
restJson1orrpcv2Cbor. - Valid names. Shape and member names are made unique without regard to case. A renamed member
keeps its wire name with
@jsonName. - Fixed: lists are no longer written as their element type. Doc comments in an imported Smithy file now attach to the right shape.
