Class SmithyIdlModelSerializer
java.lang.Object
software.amazon.smithy.model.shapes.SmithyIdlModelSerializer
Serializes a
Model
into a set of Smithy IDL files.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder used to createSmithyIdlModelSerializer
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
static Path
placeShapesByNamespace
(Shape shape) Sorts shapes into files based on their namespace, where each file is named {namespace}.smithy.Serializes aModel
into a set of Smithy IDL files.
-
Method Details
-
serialize
Serializes aModel
into a set of Smithy IDL files.The output is a mapping
By default the paths are relative paths where each namespace is given its own file in the form "namespace.smithy". This is configurable via the shape placer, which can place shapes into absolute paths.
If the model contains no shapes, or all shapes are filtered out, then a single path "metadata.smithy" will be present. This will contain only any defined metadata.
- Parameters:
model
- The model to serialize.- Returns:
- A map of (possibly relative) file paths to Smithy IDL strings.
-
builder
- Returns:
- Returns a builder used to create a
SmithyIdlModelSerializer
-
placeShapesByNamespace
Sorts shapes into files based on their namespace, where each file is named {namespace}.smithy.- Parameters:
shape
- The shape to assign a file to.- Returns:
- Returns the file the given shape should be placed in.
-