Unverified Commit 48ce90d3 authored by 82marbag's avatar 82marbag Committed by GitHub
Browse files

Dense lists cannot deserialize null (#2240)



* Dense lists cannot deserialize null

Signed-off-by: default avatarDaniele Ahmed <ahmeddan@amazon.de>
parent 2f4bc337
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -389,8 +389,22 @@ class JsonParserGenerator(
                                    withBlock("let value =", ";") {
                                        deserializeMember(shape.member)
                                    }
                                    rustBlock("if let Some(value) = value") {
                                        rust("items.push(value);")
                                    rust(
                                        """
                                        if let Some(value) = value {
                                            items.push(value);
                                        }
                                        """,
                                    )
                                    codegenTarget.ifServer {
                                        rustTemplate(
                                            """
                                            else {
                                                return Err(#{Error}::custom("dense list cannot contain null values"));
                                            }
                                            """,
                                            *codegenScope,
                                        )
                                    }
                                }
                            }
+0 −1
Original line number Diff line number Diff line
@@ -773,7 +773,6 @@ class ServerProtocolTestGenerator(
            FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request),

            FailingTest(RestJson, "RestJsonWithBodyExpectsApplicationJsonContentType", TestType.MalformedRequest),
            FailingTest(RestJson, "RestJsonBodyMalformedListNullItem", TestType.MalformedRequest),

            // Deprioritized, sets don't exist in Smithy 2.0.
            // They have the exact same semantics as list shapes with `@uniqueItems`,