-
Notifications
You must be signed in to change notification settings - Fork 6
Constraint Traits
This wiki contains a mapping between Smithy Constraint traits and generated Ruby code.
To prevent forwards incompatibility, these constraints are not validated on the client side.
Indicates that a string value MUST contain a valid absolute shape ID. The @idRef
trait is used primarily when declaring trait shapes in a model. This trait does not influence code generation.
See Smithy Documentation for more details.
Constrains a shape to minimum and maximum number of elements or size. This constraint is not validated.
@length(min: 1, max: 10)
string MyString
See Smithy Documentation for more details.
Restricts string shape values to a specified regular expression. This constraint is not validated.
@pattern("\\w+")
string MyString
See Smithy Documentation for more details.
Prevents models defined in a different namespace from referencing the targeted shape.
@private
string PrivateString
See Smithy Documentation for more details.
Restricts allowed values of byte, short, integer, long, float, double, bigDecimal, and bigInteger shapes within an acceptable lower and upper bound. This constraint is not validated.
@range(min: 1, max: 10)
integer MyInt
See Smithy Documentation for more details.
Indicates that the items in a list MUST be unique based on Value equality. This constraint is not validated.
@uniqueItems
list MyList {
member: String
}
See Smithy Documentation for more details.