Skip to content

Commit 3feb4be

Browse files
authored
Remove ignoreUnsupportedConstraintTraits from integration test models (#2516)
* Remove `ignoreUnsupportedConstraintTraits` from integration test models Now that constraint traits are supported in server SDKs (with some corner case caveats, see #1401), we can remove `ignoreUnsupportedConstraintTraits` from the codegen config of the integration test models. * Bring back ignoreUnsupportedConstraintTraits in RestJsonValidation model
1 parent a20889a commit 3feb4be

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

codegen-server-test/build.gradle.kts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
6161
"constraints",
6262
imports = listOf("$commonModels/constraints.smithy"),
6363
),
64-
CodegenTest(
65-
"aws.protocoltests.restjson#RestJson",
66-
"rest_json",
67-
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
68-
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
69-
),
64+
CodegenTest("aws.protocoltests.restjson#RestJson", "rest_json"),
7065
CodegenTest(
7166
"aws.protocoltests.restjson#RestJsonExtras",
7267
"rest_json_extras",
@@ -75,26 +70,18 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
7570
CodegenTest(
7671
"aws.protocoltests.restjson.validation#RestJsonValidation",
7772
"rest_json_validation",
73+
// `@range` trait is used on floating point shapes, which we deliberately don't want to support.
74+
// See https://github.com/awslabs/smithy-rs/issues/1401.
7875
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
7976
),
8077
CodegenTest("aws.protocoltests.json10#JsonRpc10", "json_rpc10"),
81-
CodegenTest(
82-
"aws.protocoltests.json#JsonProtocol",
83-
"json_rpc11",
84-
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
85-
),
78+
CodegenTest("aws.protocoltests.json#JsonProtocol", "json_rpc11"),
8679
CodegenTest(
8780
"aws.protocoltests.misc#MiscService",
8881
"misc",
8982
imports = listOf("$commonModels/misc.smithy"),
90-
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
91-
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
92-
),
93-
CodegenTest(
94-
"com.amazonaws.ebs#Ebs", "ebs",
95-
imports = listOf("$commonModels/ebs.json"),
96-
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
9783
),
84+
CodegenTest("com.amazonaws.ebs#Ebs", "ebs", imports = listOf("$commonModels/ebs.json")),
9885
CodegenTest("com.amazonaws.s3#AmazonS3", "s3"),
9986
CodegenTest(
10087
"com.aws.example.rust#PokemonService",

codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ValidateUnsupportedConstraints.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ fun validateUnsupportedConstraints(
262262
.map { (shape, rangeTrait) -> UnsupportedRangeTraitOnShape(shape, rangeTrait as RangeTrait) }
263263
.toSet()
264264

265-
// 5. `@uniqueItems` cannot reach a map shape.
265+
// 4. `@uniqueItems` cannot reach a map shape.
266266
// See https://github.com/awslabs/smithy/issues/1567.
267267
val mapShapeReachableFromUniqueItemsListShapeSet = walker
268268
.walkShapes(service)

0 commit comments

Comments
 (0)