Unverified Commit 3feb4bef authored by david-perez's avatar david-perez Committed by GitHub
Browse files

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
https://github.com/awslabs/smithy-rs/issues/1401), we can remove
`ignoreUnsupportedConstraintTraits` from the codegen config of the
integration test models.

* Bring back ignoreUnsupportedConstraintTraits in RestJsonValidation model
parent a20889a2
Loading
Loading
Loading
Loading
+5 −18
Original line number Diff line number Diff line
@@ -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",
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -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)