Export to Smithy from the Export dialog and the CLI
The Export dialog's Smithy card writes a Smithy 2.0 model and shows its four options:
Output, Protocol, Include Comments and Smithy Version. The CLI exports the same with
apiome export smithy. Where to find it.
- IDL, JSON AST or both. Output is
idl(.smithy) by default. Pickjson-astfor the Smithy JSON AST orbothfor the two; from the CLI, add--option output=json-ast. - Protocol traits. Set Protocol to
restJson1orrpcv2Cborto mark each service with that protocol trait. - High fidelity. Constraints become constraint traits (
@range,@length,@pattern), and required fields@required. An item imported from Smithy badges lossless; any other source is lossy, and the fidelity report lists what Smithy does not keep.
