Skip to content

Commit

Permalink
Remove ignoreUnsupportedConstraintTraits from integration test mode…
Browse files Browse the repository at this point in the history
…ls (#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
  • Loading branch information
david-perez authored Apr 3, 2023
1 parent a20889a commit 3feb4be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
23 changes: 5 additions & 18 deletions codegen-server-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
"constraints",
imports = listOf("$commonModels/constraints.smithy"),
),
CodegenTest(
"aws.protocoltests.restjson#RestJson",
"rest_json",
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.restjson#RestJson", "rest_json"),
CodegenTest(
"aws.protocoltests.restjson#RestJsonExtras",
"rest_json_extras",
Expand All @@ -75,26 +70,18 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
CodegenTest(
"aws.protocoltests.restjson.validation#RestJsonValidation",
"rest_json_validation",
// `@range` trait is used on floating point shapes, which we deliberately don't want to support.
// See https://github.com/awslabs/smithy-rs/issues/1401.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.json10#JsonRpc10", "json_rpc10"),
CodegenTest(
"aws.protocoltests.json#JsonProtocol",
"json_rpc11",
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.json#JsonProtocol", "json_rpc11"),
CodegenTest(
"aws.protocoltests.misc#MiscService",
"misc",
imports = listOf("$commonModels/misc.smithy"),
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest(
"com.amazonaws.ebs#Ebs", "ebs",
imports = listOf("$commonModels/ebs.json"),
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("com.amazonaws.ebs#Ebs", "ebs", imports = listOf("$commonModels/ebs.json")),
CodegenTest("com.amazonaws.s3#AmazonS3", "s3"),
CodegenTest(
"com.aws.example.rust#PokemonService",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fun validateUnsupportedConstraints(
.map { (shape, rangeTrait) -> UnsupportedRangeTraitOnShape(shape, rangeTrait as RangeTrait) }
.toSet()

// 5. `@uniqueItems` cannot reach a map shape.
// 4. `@uniqueItems` cannot reach a map shape.
// See https://github.com/awslabs/smithy/issues/1567.
val mapShapeReachableFromUniqueItemsListShapeSet = walker
.walkShapes(service)
Expand Down

0 comments on commit 3feb4be

Please sign in to comment.