You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ValidateUnsupportedConstraints.kt
+16-1
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,10 @@ private sealed class UnsupportedConstraintMessageKind {
Copy file name to clipboardExpand all lines: codegen-server/src/test/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ValidateUnsupportedConstraintsAreNotUsedTest.kt
+21
Original file line number
Diff line number
Diff line change
@@ -214,6 +214,27 @@ internal class ValidateUnsupportedConstraintsAreNotUsedTest {
214
214
validationResult.messages[0].message shouldContain "The integer shape `test#RangeInteger` has the constraint trait `smithy.api#range` attached"
215
215
}
216
216
217
+
@Test
218
+
fun`it should detect when the unique items trait is used`() {
219
+
val model =
220
+
"""
221
+
$baseModel
222
+
223
+
structure TestInputOutput {
224
+
uniqueItemsList: UniqueItemsList
225
+
}
226
+
227
+
@uniqueItems
228
+
list UniqueItemsList {
229
+
member: String
230
+
}
231
+
""".asSmithyModel()
232
+
val validationResult = validateModel(model)
233
+
234
+
validationResult.messages shouldHaveSize 1
235
+
validationResult.messages[0].message shouldContain "The list shape `test#UniqueItemsList` has the constraint trait `smithy.api#uniqueItems` attached"
236
+
}
237
+
217
238
@Test
218
239
fun`it should abort when ignoreUnsupportedConstraints is false and unsupported constraints are used`() {
219
240
val validationResult = validateModel(constraintTraitOnStreamingBlobShapeModel, ServerCodegenConfig())
0 commit comments