Unverified Commit f1a726c1 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Smithy 1.9/1.10 Upgrade (#618)



* smithy 1.9.1 upgrade & primitive encode/decode

This upgrades to Smithy 1.10, but the major change is a complete overhaul of how primitives are formatted and parsed. Primitive serialization was migrated and unified into Smithy Types with the end requirement of dealing with special float serialization semantics.

* Switch to Smithy Core S3 Customization Trait

Smithy 1.9.1 brings S3UnwrappedXmlOutput as a vended trait. This commit pulls in the new model & uses that trait.

* Fix clippy warnings

* Fix doc links

* fix kotlin formatting

* Fix s3 customization to use the operation shape

* Ensure that numbers in string don't parse as numbers

* remove unused itoa

* Apply suggestions from code review

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* Fix tests, CR feedback

* rename parse to parse_smithy_primitive

* Fix some more clippy errors

* Update changelog

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
parent 9fef09af
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
**New This Week**
- :bug: Correctly encode HTTP Checksums using base64 instead of hex. Fixes aws-sdk-rust#164. (#615)
- (When complete) Add profile file provider for region (#594, #xyz)
- Overhaul serialization/deserialization of numeric/boolean types. This resolves issues around serialization of NaN/Infinity and should also reduce the number of allocations required during serialization. (#618)

## v0.18.1 (July 27th 2021)
* Remove timestreamwrite and timestreamquery from the generated services (#613)
+0 −19
Original line number Diff line number Diff line
@@ -6,12 +6,8 @@
package software.amazon.smithy.rustsdk.customize.s3

import software.amazon.smithy.aws.traits.protocols.RestXmlTrait
import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.shapes.StructureShape
import software.amazon.smithy.model.transform.ModelTransformer
import software.amazon.smithy.rust.codegen.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.rustlang.Writable
import software.amazon.smithy.rust.codegen.rustlang.asType
@@ -28,7 +24,6 @@ import software.amazon.smithy.rust.codegen.smithy.letIf
import software.amazon.smithy.rust.codegen.smithy.protocols.ProtocolMap
import software.amazon.smithy.rust.codegen.smithy.protocols.RestXml
import software.amazon.smithy.rust.codegen.smithy.protocols.RestXmlFactory
import software.amazon.smithy.rust.codegen.smithy.traits.S3UnwrappedXmlOutputTrait
import software.amazon.smithy.rustsdk.AwsRuntimeType

/**
@@ -59,20 +54,6 @@ class S3Decorator : RustCodegenDecorator {
            it + S3PubUse()
        }
    }

    override fun transformModel(service: ServiceShape, model: Model): Model {
        return model.letIf(applies(service.id)) {
            ModelTransformer.create().mapShapes(model) { shape ->
                // Apply the S3UnwrappedXmlOutput customization to GetBucketLocation (more
                // details on the S3UnwrappedXmlOutputTrait)
                if (shape is StructureShape && shape.id == ShapeId.from("com.amazonaws.s3#GetBucketLocationOutput")) {
                    shape.toBuilder().addTrait(S3UnwrappedXmlOutputTrait()).build()
                } else {
                    shape
                }
            }
        }
    }
}

class S3(protocolConfig: ProtocolConfig) : RestXml(protocolConfig) {
+1 −0
Original line number Diff line number Diff line
@@ -4073,6 +4073,7 @@
                "target": "com.amazonaws.s3#GetBucketLocationOutput"
            },
            "traits": {
                "aws.customizations#s3UnwrappedXmlOutput": {},
                "smithy.api#documentation": "<p>Returns the Region the bucket resides in. You set the bucket's Region using the\n            <code>LocationConstraint</code> request parameter in a <code>CreateBucket</code>\n         request. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html\">CreateBucket</a>.</p>\n\n         <p> To use this implementation of the operation, you must be the bucket owner.</p>\n\n         <p>The following operations are related to <code>GetBucketLocation</code>:</p>\n         <ul>\n            <li>\n               <p>\n                  <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html\">GetObject</a>\n               </p>\n            </li>\n            <li>\n               <p>\n                  <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html\">CreateBucket</a>\n               </p>\n            </li>\n         </ul>",
                "smithy.api#http": {
                    "method": "GET",
+0 −1
Original line number Diff line number Diff line
@@ -12,4 +12,3 @@ aws-types = { path = "../../build/aws-sdk/aws-types" }
tokio = { version = "1", features = ["full"] }
structopt = { version = "0.3", default-features = false }
tracing-subscriber = { version = "0.2.16", features = ["fmt"] }
+0 −2
Original line number Diff line number Diff line
@@ -13,5 +13,3 @@ aws-types = { path = "../../build/aws-sdk/aws-types" }
tokio = { version = "1", features = ["full"] }
structopt = { version = "0.3", default-features = false }
tracing-subscriber = { version = "0.2.16", features = ["fmt"] }

Loading