Skip to content

Commit

Permalink
Upgrade Smithy to 1.44
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Feb 8, 2024
1 parent ae52b69 commit ed7625c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 56 deletions.
24 changes: 24 additions & 0 deletions codegen-core/common-test-models/rest-json-extras.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ use smithy.test#httpRequestTests
use smithy.test#httpResponseTests
use smithy.framework#ValidationException

// TODO(https://github.com/smithy-lang/smithy/pull/2132): Remove this test once it's fixed in Smithy
apply AllQueryStringTypes @httpRequestTests([
{
id: "RestJsonZeroAndFalseQueryValuesFixed"
documentation: "Query values of 0 and false are serialized"
protocol: restJson1
method: "GET"
uri: "/AllQueryStringTypesInput"
body: ""
queryParams: [
"Integer=0"
"Boolean=false"
]
params: {
queryInteger: 0
queryBoolean: false
queryParamsMapOfStringList: {
queryInteger: ["0"]
queryBoolean: ["false"]
}
}
}
])

apply QueryPrecedence @httpRequestTests([
{
id: "UrlParamsKeyEncoding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ class ServerProtocolTestGenerator(
FailingTest(RestJson, "RestJsonEndpointTrait", TestType.Request),
FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request),
FailingTest(RestJson, "RestJsonOmitsEmptyListQueryValues", TestType.Request),
// TODO(https://github.com/smithy-lang/smithy/pull/2132): Remove this failing test once it's fixed in Smithy
FailingTest(RestJson, "RestJsonZeroAndFalseQueryValues", TestType.Request),
// Tests involving `@range` on floats.
// Pending resolution from the Smithy team, see https://github.com/smithy-lang/smithy-rs/issues/2007.
FailingTest(RestJsonValidation, "RestJsonMalformedRangeFloat_case0", TestType.MalformedRequest),
Expand Down Expand Up @@ -912,60 +914,6 @@ class ServerProtocolTestGenerator(
"S3EscapePathObjectKeyInUriLabel",
)

private fun fixRestJsonAllQueryStringTypes(
testCase: HttpRequestTestCase,
@Suppress("UNUSED_PARAMETER")
operationShape: OperationShape,
): HttpRequestTestCase =
testCase.toBuilder().params(
Node.parse(
"""
{
"queryString": "Hello there",
"queryStringList": ["a", "b", "c"],
"queryStringSet": ["a", "b", "c"],
"queryByte": 1,
"queryShort": 2,
"queryInteger": 3,
"queryIntegerList": [1, 2, 3],
"queryIntegerSet": [1, 2, 3],
"queryLong": 4,
"queryFloat": 1.1,
"queryDouble": 1.1,
"queryDoubleList": [1.1, 2.1, 3.1],
"queryBoolean": true,
"queryBooleanList": [true, false, true],
"queryTimestamp": 1,
"queryTimestampList": [1, 2, 3],
"queryEnum": "Foo",
"queryIntegerEnum": 1,
"queryIntegerEnumList": [1,2,3],
"queryEnumList": ["Foo", "Baz", "Bar"],
"queryParamsMapOfStringList": {
"String": ["Hello there"],
"StringList": ["a", "b", "c"],
"StringSet": ["a", "b", "c"],
"Byte": ["1"],
"Short": ["2"],
"Integer": ["3"],
"IntegerList": ["1", "2", "3"],
"IntegerSet": ["1", "2", "3"],
"Long": ["4"],
"Float": ["1.1"],
"Double": ["1.1"],
"DoubleList": ["1.1", "2.1", "3.1"],
"Boolean": ["true"],
"BooleanList": ["true", "false", "true"],
"Timestamp": ["1970-01-01T00:00:01Z"],
"TimestampList": ["1970-01-01T00:00:01Z", "1970-01-01T00:00:02Z", "1970-01-01T00:00:03Z"],
"Enum": ["Foo"],
"EnumList": ["Foo", "Baz", "Bar"]
}
}
""".trimMargin(),
).asObjectNode().get(),
).build()

// TODO(https://github.com/awslabs/smithy/issues/1506)
private fun fixRestJsonMalformedPatternReDOSString(
testCase: HttpMalformedRequestTestCase,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin.code.style=official

# codegen
smithyGradlePluginVersion=0.9.0
smithyVersion=1.43.0
smithyVersion=1.44.0

# kotlin
kotlinVersion=1.9.20
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-types/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Binary Blob Type
///
/// Blobs represent protocol-agnostic binary content.
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, Default, PartialEq, Eq, Hash, Clone)]
pub struct Blob {
inner: Vec<u8>,
}
Expand Down

0 comments on commit ed7625c

Please sign in to comment.