Repository: smithy-lang/smithy
Pull request #2322 (2024-06-12 20:18:54)

Add restJson1 protocol test for content-type and operation with no input
#### Background
- Requests should not have the content-type header added when there is no input shape (and therefore no payload)
  - This doesn't appear to be a case in the aws sdk (operations with no input), but could be in generic clients 

#### Testing
- Tested by running protocol tests in the typescript sdk

#### Links
- Related to https://github.com/smithy-lang/smithy-typescript/pull/1304

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.



Patch:
diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/WriterDelegator.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/WriterDelegator.java
index 0156be49c..31492a473 100644
--- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/WriterDelegator.java
+++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/WriterDelegator.java
@@ -176,8 +176,7 @@ public class WriterDelegator<W extends SymbolWriter<W, ? extends ImportContainer
     }
 
     /**
-     * Gets or creates a writer for a {@link Shape} by converting the {@link Shape}
-     * to a {@code Symbol}.
+     * Gets or creates a writer for a {@link Symbol}.
      *
      * <p>Any dependencies (i.e., {@link SymbolDependency}) required by the
      * {@code Symbol} are automatically registered with the writer.
@@ -190,14 +189,10 @@ public class WriterDelegator<W extends SymbolWriter<W, ? extends ImportContainer
      * the writer (either a newline or whatever value was set on
      * {@link #setAutomaticSeparator}).
      *
-     * <p>This method may be overridden as needed.
-     *
-     * @param shape Shape to create the writer for.
+     * @param symbol Symbol to create the writer for.
      * @param writerConsumer Consumer that is expected to write to the {@code SymbolWriter}.
      */
-    public void useShapeWriter(Shape shape, Consumer<W> writerConsumer) {
-        // Checkout/create the appropriate writer for the shape.
-        Symbol symbol = symbolProvider.toSymbol(shape);
+    public final void useSymbolWriter(Symbol symbol, Consumer<W> writerConsumer) {
         W writer = checkoutWriter(symbol.getDefinitionFile(), symbol.getNamespace());
 
         // Add any needed DECLARE symbols.
@@ -209,6 +204,31 @@ public class WriterDelegator<W extends SymbolWriter<W, ? extends ImportContainer
         writer.popState();
     }
 
+    /**
+     * Gets or creates a writer for a {@link Shape} by converting the {@link Shape}
+     * to a {@code Symbol}.
+     *
+     * <p>Any dependencies (i.e., {@link SymbolDependency}) required by the
+     * {@code Symbol} are automatically registered with the writer.
+     *
+     * <p>Any imports required to declare the {@code Symbol} in code (i.e.,
+     * {@link SymbolReference.ContextOption#DECLARE}) are automatically
+     * registered with the writer.
+     *
+     * <p>If a writer already exists, a newline is automatically appended to
+     * the writer (either a newline or whatever value was set on
+     * {@link #setAutomaticSeparator}).
+     *
+     * <p>This method may be overridden as needed.
+     *
+     * @param shape Shape to create the writer for.
+     * @param writerConsumer Consumer that is expected to write to the {@code SymbolWriter}.
+     */
+    public void useShapeWriter(Shape shape, Consumer<W> writerConsumer) {
+        // Checkout/create the appropriate writer for the shape.
+        useSymbolWriter(symbolProvider.toSymbol(shape), writerConsumer);
+    }
+
     /**
      * Sets the automatic separator that is written to a {@code SymbolWriter}
      * each time the writer is reused.


Test patch:
diff --git a/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy b/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy
index 3301bb601..0f8d28625 100644
--- a/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy
+++ b/smithy-aws-protocol-tests/model/restJson1/http-content-type.smithy
@@ -284,3 +284,31 @@ structure TestNoPayloadInputOutput {
     @httpHeader("X-Amz-Test-Id")
     testId: String,
 }
+
+/// This example operation has no input and serializes a request without an HTTP body.
+///
+/// These tests are to ensure we do not attach a body or related headers
+/// (Content-Length, Content-Type) to operations that semantically
+/// cannot produce an HTTP body.
+///
+@readonly
+@http(uri: "/no_input_no_payload", method: "GET")
+operation TestNoInputNoPayload {
+    output: TestNoPayloadInputOutput
+}
+
+apply TestNoInputNoPayload @httpRequestTests([
+    {
+        id: "RestJsonHttpWithNoInput",
+        documentation: "Serializes a GET request for an operation with no input, and therefore no modeled body",
+        protocol: restJson1,
+        method: "GET",
+        uri: "/no_input_no_payload",
+        body: "",
+        forbidHeaders: [
+            "Content-Length",
+            "Content-Type"
+        ],
+        params: {}
+    }
+])
diff --git a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy
index d2acdae8f..14d1e19c7 100644
--- a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy
+++ b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy
@@ -6,6 +6,7 @@ $version: "2.0"
 namespace aws.protocoltests.restjson
 
 use aws.protocols#restJson1
+use smithy.test#httpMalformedRequestTests
 use aws.protocoltests.shared#TextPlainBlob
 use smithy.test#httpRequestTests
 use smithy.test#httpResponseTests
@@ -76,6 +77,26 @@ apply HttpPayloadTraits @httpRequestTests([
         },
         appliesTo: "server",
     },
+    {
+        id: "RestJsonHttpPayloadTraitsWithBlobAcceptsNoContentType",
+        documentation: """
+            Servers must accept no content type for blob inputs
+            without the media type trait.""",
+        protocol: restJson1,
+        method: "POST",
+        uri: "/HttpPayloadTraits",
+        body: "This is definitely a jpeg",
+        bodyMediaType: "application/octet-stream",
+        headers: {
+            "X-Foo": "Foo",
+        },
+        params: {
+            foo: "Foo",
+            blob: "This is definitely a jpeg"
+        },
+        appliesTo: "server",
+        tags: [ "content-type" ]
+    },
     {
         id: "RestJsonHttpPayloadTraitsWithBlobAcceptsAllAccepts",
         documentation: """
@@ -353,3 +374,120 @@ structure HttpPayloadWithUnionInputOutput {
 union UnionPayload {
     greeting: String
 }
+
+/// This example serializes a string shape in the payload.
+///
+/// In this example, no JSON document is synthesized because the payload is
+/// not a structure or a union type.
+@http(uri: "/HttpPayloadTraitOnString", method: "POST")
+operation HttpPayloadTraitOnString {
+    input: HttpPayloadTraitOnStringInputOutput,
+    output: HttpPayloadTraitOnStringInputOutput
+}
+
+structure HttpPayloadTraitOnStringInputOutput {
+    @httpPayload
+    foo: String,
+}
+
+apply HttpPayloadTraitOnString @httpRequestTests([
+    {
+        id: "RestJsonHttpPayloadTraitOnString",
+        documentation: "Serializes a string in the HTTP payload",
+        protocol: restJson1,
+        method: "POST",
+        uri: "/HttpPayloadTraitOnString",
+        body: "Foo",
+        bodyMediaType: "text/plain",
+        headers: {
+            "Content-Type": "text/plain",
+        },
+        requireHeaders: [
+            "Content-Length"
+        ],
+        params: {
+            foo: "Foo",
+        }
+    },
+])
+
+apply HttpPayloadTraitOnString @httpResponseTests([
+    {
+        id: "RestJsonHttpPayloadTraitOnString",
+        documentation: "Serializes a string in the HTTP payload",
+        protocol: restJson1,
+        code: 200,
+        body: "Foo",
+        bodyMediaType: "text/plain",
+        headers: {
+            "Content-Type": "text/plain",
+        },
+        params: {
+            foo: "Foo",
+        }
+    },
+])
+
+apply HttpPayloadTraitOnString @httpMalformedRequestTests([
+    {
+        id: "RestJsonHttpPayloadTraitOnStringNoContentType",
+        documentation: "Serializes a string in the HTTP payload without a content-type header",
+        protocol: restJson1,
+        request: {
+            method: "POST",
+            uri: "/HttpPayloadTraitOnString",
+            body: "Foo",
+            // We expect a `Content-Type` header but none was provided.
+        },
+        response: {
+            code: 415,
+            headers: {
+                "x-amzn-errortype": "UnsupportedMediaTypeException"
+            }
+        },
+        tags: [ "content-type" ]
+    },
+    {
+        id: "RestJsonHttpPayloadTraitOnStringWrongContentType",
+        documentation: "Serializes a string in the HTTP payload without the expected content-type header",
+        protocol: restJson1,
+        request: {
+            method: "POST",
+            uri: "/HttpPayloadTraitOnString",
+            body: "Foo",
+            headers: {
+                // We expect `text/plain`.
+                "Content-Type": "application/json",
+            },
+        },
+        response: {
+            code: 415,
+            headers: {
+                "x-amzn-errortype": "UnsupportedMediaTypeException"
+            }
+        },
+        tags: [ "content-type" ]
+    },
+    {
+        id: "RestJsonHttpPayloadTraitOnStringUnsatisfiableAccept",
+        documentation: "Serializes a string in the HTTP payload with an unstatisfiable accept header",
+        protocol: restJson1,
+        request: {
+            method: "POST",
+            uri: "/HttpPayloadTraitOnString",
+            body: "Foo",
+            headers: {
+                "Content-Type": "text/plain",
+                // We can't satisfy this requirement; the server will return `text/plain`.
+                "Accept": "application/json",
+            },
+        },
+        response: {
+            code: 406,
+            headers: {
+                "x-amzn-errortype": "NotAcceptableException"
+            }
+        },
+        tags: [ "accept" ]
+    },
+])
diff --git a/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy b/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy
index 8aa1f517b..52cab5cc9 100644
--- a/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy
+++ b/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy
@@ -10,6 +10,7 @@ use smithy.test#httpResponseTests
     {
         id: "RestJsonEnumPayloadRequest",
         uri: "/EnumPayload",
+        headers: { "Content-Type": "text/plain" },
         body: "enumvalue",
         params: { payload: "enumvalue" },
         method: "POST",
@@ -19,6 +20,7 @@ use smithy.test#httpResponseTests
 @httpResponseTests([
     {
         id: "RestJsonEnumPayloadResponse",
+        headers: { "Content-Type": "text/plain" },
         body: "enumvalue",
         params: { payload: "enumvalue" },
         protocol: "aws.protocols#restJson1",
@@ -44,6 +46,7 @@ enum StringEnum {
     {
         id: "RestJsonStringPayloadRequest",
         uri: "/StringPayload",
+        headers: { "Content-Type": "text/plain" },
         body: "rawstring",
         params: { payload: "rawstring" },
         method: "POST",
@@ -53,6 +56,7 @@ enum StringEnum {
 @httpResponseTests([
     {
         id: "RestJsonStringPayloadResponse",
+        headers: { "Content-Type": "text/plain" },
         body: "rawstring",
         params: { payload: "rawstring" },
         protocol: "aws.protocols#restJson1",
diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy
index 2a414502b..ad29e0067 100644
--- a/smithy-aws-protocol-tests/model/restJson1/main.smithy
+++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy
@@ -62,6 +62,7 @@ service RestJson {
         HttpEnumPayload,
         HttpStringPayload,
         HttpPayloadWithUnion,
+        HttpPayloadTraitOnString,
 
         // @httpResponseCode tests
         HttpResponseCode,
@@ -145,6 +146,7 @@ service RestJson {
         TestPayloadStructure,
         TestPayloadBlob,
         TestNoPayload,
+        TestNoInputNoPayload,
 
         // client-only timestamp parsing tests
         DatetimeOffsets,
diff --git a/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy b/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy
index 851e34066..9b25b3af0 100644
--- a/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy
+++ b/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy
@@ -10,6 +10,7 @@ use smithy.test#httpResponseTests
     {
         id: "RestXmlEnumPayloadRequest",
         uri: "/EnumPayload",
+        headers: { "Content-Type": "text/plain" },
         body: "enumvalue",
         params: { payload: "enumvalue" },
         method: "POST",
@@ -19,6 +20,7 @@ use smithy.test#httpResponseTests
 @httpResponseTests([
     {
         id: "RestXmlEnumPayloadResponse",
+        headers: { "Content-Type": "text/plain" },
         body: "enumvalue",
         params: { payload: "enumvalue" },
         protocol: "aws.protocols#restXml",
@@ -44,6 +46,7 @@ enum StringEnum {
     {
         id: "RestXmlStringPayloadRequest",
         uri: "/StringPayload",
+        headers: { "Content-Type": "text/plain" },
         body: "rawstring",
         params: { payload: "rawstring" },
         method: "POST",
@@ -53,6 +56,7 @@ enum StringEnum {
 @httpResponseTests([
     {
         id: "RestXmlStringPayloadResponse",
+        headers: { "Content-Type": "text/plain" },
         body: "rawstring",
         params: { payload: "rawstring" },
         protocol: "aws.protocols#restXml",
diff --git a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/WriterDelegatorTest.java b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/WriterDelegatorTest.java
index 4a5f48de0..b1ed5400a 100644
--- a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/WriterDelegatorTest.java
+++ b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/WriterDelegatorTest.java
@@ -47,6 +47,22 @@ public class WriterDelegatorTest {
         assertThat(delegator.getWriters(), hasKey(Paths.get("com/foo/Baz.bam").toString()));
     }
 
+    @Test
+    public void createsFilesForSymbolWriters() {
+        MockManifest mockManifest = new MockManifest();
+        SymbolProvider provider = (shape) -> null;
+        WriterDelegator<MySimpleWriter> delegator = new WriterDelegator<>(
+                mockManifest, provider, (f, n) -> new MySimpleWriter(n));
+        Symbol symbol =  Symbol.builder()
+                .namespace("com.foo", ".")
+                .name("Baz")
+                .definitionFile("com/foo/Baz.bam")
+                .build();
+        delegator.useSymbolWriter(symbol, writer -> { });
+
+        assertThat(delegator.getWriters(), hasKey(Paths.get("com/foo/Baz.bam").toString()));
+    }
+
     @Test
     public void aggregatesDependencies() {
         MockManifest mockManifest = new MockManifest();
diff --git a/smithy-protocol-tests/model/rpcv2Cbor/cbor-structs.smithy b/smithy-protocol-tests/model/rpcv2Cbor/cbor-structs.smithy
index 3bb58462a..7ea41d9cf 100644
--- a/smithy-protocol-tests/model/rpcv2Cbor/cbor-structs.smithy
+++ b/smithy-protocol-tests/model/rpcv2Cbor/cbor-structs.smithy
@@ -21,12 +21,12 @@ use smithy.test#httpResponseTests
         method: "POST",
         bodyMediaType: "application/cbor",
         uri: "/service/RpcV2Protocol/operation/SimpleScalarProperties",
-        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kDz989saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w=="
+        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==",
         params: {
             byteValue: 5,
             doubleValue: 1.889,
             falseBooleanValue: false,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             longValue: 9873,
             shortValue: 9898,
@@ -52,12 +52,12 @@ use smithy.test#httpResponseTests
         method: "POST",
         bodyMediaType: "application/cbor",
         uri: "/service/RpcV2Protocol/operation/SimpleScalarProperties",
-        body: "qmlieXRlVmFsdWUFf2Zkb3VibGVlVmFsdWX/+z/+OVgQYk3Tf2VmYWxzZWdCb29sZWFuZVZhbHVl//RqZmxvYXRWYWx1ZfpA8/fPbGludGVnZXJWYWx1ZRkBAGlsb25nVmFsdWUZJpFqc2hvcnRWYWx1ZRkmqn9mc3RyaW5nZVZhbHVl/2ZzaW1wbGVwdHJ1ZUJvb2xlYW5WYWx1ZfVpYmxvYlZhbHVlQ2Zvbw=="
+        body: "qmlieXRlVmFsdWUFf2Zkb3VibGVlVmFsdWX/+z/+OVgQYk3Tf2VmYWxzZWdCb29sZWFuZVZhbHVl//RqZmxvYXRWYWx1ZfpA9AAAbGludGVnZXJWYWx1ZRkBAGlsb25nVmFsdWUZJpFqc2hvcnRWYWx1ZRkmqn9mc3RyaW5nZVZhbHVl/2ZzaW1wbGVwdHJ1ZUJvb2xlYW5WYWx1ZfVpYmxvYlZhbHVlQ2Zvbw==",
         params: {
             byteValue: 5,
             doubleValue: 1.889,
             falseBooleanValue: false,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             longValue: 9873,
             shortValue: 9898,
@@ -246,12 +246,12 @@ use smithy.test#httpResponseTests
         method: "POST",
         bodyMediaType: "application/cbor",
         uri: "/service/RpcV2Protocol/operation/SimpleScalarProperties",
-        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kDz989rZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==",
+        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==",
         params: {
             byteValue: 5,
             doubleValue: 1.889,
             falseBooleanValue: false,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             longValue: 9873,
             shortValue: 9898,
@@ -272,14 +272,14 @@ use smithy.test#httpResponseTests
             "Content-Type": "application/cbor"
         }
         bodyMediaType: "application/cbor",
-        body: "v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kDz989saW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//"
+        body: "v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//",
         code: 200,
         params: {
             trueBooleanValue: true,
             falseBooleanValue: false,
             byteValue: 5,
             doubleValue: 1.889,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             shortValue: 9898,
             stringValue: "simple",
@@ -295,14 +295,14 @@ use smithy.test#httpResponseTests
             "Content-Type": "application/cbor"
         }
         bodyMediaType: "application/cbor",
-        body: "qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kDz989saW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28="
+        body: "qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28=",
         code: 200,
         params: {
             trueBooleanValue: true,
             falseBooleanValue: false,
             byteValue: 5,
             doubleValue: 1.889,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             shortValue: 9898,
             stringValue: "simple",
@@ -421,12 +421,12 @@ use smithy.test#httpResponseTests
         }
         code: 200,
         bodyMediaType: "application/cbor",
-        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kDz989rZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==",
+        body: "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==",
         params: {
             byteValue: 5,
             doubleValue: 1.889,
             falseBooleanValue: false,
-            floatValue: 7.624,
+            floatValue: 7.625,
             integerValue: 256,
             longValue: 9873,
             shortValue: 9898,