Skip to content

Commit 991e9e8

Browse files
ysaito1001drganjooFahad Zubair
authored
Bump Smithy to 1.67.0 (#4533)
## Motivation and Context P382257849 ## Description Changes on the client side: - [x] Remove extra rest json tests that are officially part of Smithy protocol tests in 1.64.0 - [x] Filter out newly added model in `SmithyTypesPubUseExtraTest.kt` that would otherwise defeat the purpose of the test Changes on the server side: - [x] Address errors related to server's constraint types (#4506) - [x] #4535 - [x] #4537 ## Testing - CI ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Fahad Zubair <fahadzubair@gmail.com> Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
1 parent e371005 commit 991e9e8

File tree

8 files changed

+18
-49
lines changed

8 files changed

+18
-49
lines changed

codegen-core/common-test-models/rest-json-extras.smithy

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ service RestJsonExtras {
6666
CaseInsensitiveErrorOperation,
6767
EmptyStructWithContentOnWireOp,
6868
QueryPrecedence,
69-
HttpQueryParamsOnlyOperation,
7069
],
7170
errors: [ExtraError]
7271
}
@@ -351,46 +350,3 @@ structure EmptyStructWithContentOnWireOpOutput {
351350
operation EmptyStructWithContentOnWireOp {
352351
output: EmptyStructWithContentOnWireOpOutput,
353352
}
354-
355-
@http(uri: "/http-query-params-only", method: "GET")
356-
@httpRequestTests([
357-
{
358-
id: "HttpQueryParamsOnlyRequest",
359-
documentation: "Test that httpQueryParams are included in request when no other query parameters exist",
360-
protocol: "aws.protocols#restJson1",
361-
method: "GET",
362-
uri: "/http-query-params-only",
363-
queryParams: ["shouldExpandRoles=true", "shouldShowOnlyAuthForThisDocument=false"],
364-
params: {
365-
queryMap: {
366-
"shouldExpandRoles": "true",
367-
"shouldShowOnlyAuthForThisDocument": "false"
368-
}
369-
},
370-
appliesTo: "client",
371-
},
372-
{
373-
id: "HttpQueryParamsOnlyEmptyRequest",
374-
documentation: "Test that empty httpQueryParams map results in no query parameters",
375-
protocol: "aws.protocols#restJson1",
376-
method: "GET",
377-
uri: "/http-query-params-only",
378-
params: {
379-
queryMap: {}
380-
},
381-
appliesTo: "client",
382-
}
383-
])
384-
operation HttpQueryParamsOnlyOperation {
385-
input: HttpQueryParamsOnlyInput,
386-
}
387-
388-
structure HttpQueryParamsOnlyInput {
389-
@httpQueryParams
390-
queryMap: QueryMap,
391-
}
392-
393-
map QueryMap {
394-
key: String,
395-
value: String,
396-
}

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/AllowLintsCustomization.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ private val allowedClippyLints =
4747
"result_large_err",
4848
// Difficult to avoid in generated code
4949
"unnecessary_map_on_constructor",
50+
// Introduced by Python server codegen but needs to be suppressed for regular codegen (https://github.com/smithy-lang/smithy-rs/pull/4537)
51+
"useless_conversion",
5052
// Service models can specify a date, such as 2024-01-08, as the "since" date for deprecation.
5153
"deprecated_semver",
5254
)

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/EventStreamMarshallerGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ open class EventStreamMarshallerGenerator(
265265
is BlobShape -> "ByteArray($inputName.into_inner().into())"
266266
is EnumShape -> "String($inputName.to_string().into())"
267267
is StringShape -> "String($inputName.into())"
268-
is TimestampShape -> "Timestamp($inputName)"
268+
is TimestampShape -> "Timestamp($inputName.into())"
269269
else -> throw IllegalStateException("unsupported event stream header shape type: $target")
270270
}
271271

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,15 @@ fun String.asSmithyModel(
150150
sourceLocation: String? = null,
151151
smithyVersion: String = SMITHY_VERSION,
152152
disableValidation: Boolean = false,
153+
additionalDeniedModels: Array<String> = emptyArray(),
153154
): Model {
154155
val processed = letIf(!this.trimStart().startsWith("\$version")) { "\$version: ${smithyVersion.dq()}\n$it" }
155156
val denyModelsContaining =
156157
arrayOf(
157158
// If Smithy protocol test models are in our classpath, don't load them, since they are fairly large and we
158159
// almost never need them.
159160
"smithy-protocol-tests",
160-
)
161+
) + additionalDeniedModels
161162
val urls =
162163
ModelDiscovery.findModels().filter { modelUrl ->
163164
denyModelsContaining.none {

codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtraTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class SmithyTypesPubUseExtraTest {
4747
input: SomeInput,
4848
output: SomeOutput
4949
}
50-
""".asSmithyModel()
50+
""".asSmithyModel(
51+
// Filters out models containing `smithy.test#EventHeaderValue` to avoid pulling in
52+
// blob and timestamp types, which would defeat the purpose of this test.
53+
additionalDeniedModels = arrayOf("smithy-protocol-test-traits"),
54+
)
5155
}
5256

5357
private fun initialize(model: Model): Pair<CodegenContext, RustCrate> {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kotlin-version = "2.1.0"
33
ktlint-version = "1.0.1"
44

55
# codegen
6-
smithy-version = "1.63.0"
6+
smithy-version = "1.67.0"
77
smithy-gradle-plugin-version = "1.3.0"
88

99
# publishing

rust-runtime/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-runtime/aws-smithy-http-server-python/src/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@ impl From<aws_smithy_types::DateTime> for DateTime {
373373
}
374374
}
375375

376+
impl From<DateTime> for aws_smithy_types::DateTime {
377+
fn from(other: DateTime) -> aws_smithy_types::DateTime {
378+
other.0
379+
}
380+
}
381+
376382
impl Deref for DateTime {
377383
type Target = aws_smithy_types::DateTime;
378384

0 commit comments

Comments
 (0)