Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions codegen-core/common-test-models/rest-json-extras.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ service RestJsonExtras {
CaseInsensitiveErrorOperation,
EmptyStructWithContentOnWireOp,
QueryPrecedence,
HttpQueryParamsOnlyOperation,
],
errors: [ExtraError]
}
Expand Down Expand Up @@ -351,46 +350,3 @@ structure EmptyStructWithContentOnWireOpOutput {
operation EmptyStructWithContentOnWireOp {
output: EmptyStructWithContentOnWireOpOutput,
}

@http(uri: "/http-query-params-only", method: "GET")
@httpRequestTests([
{
id: "HttpQueryParamsOnlyRequest",
documentation: "Test that httpQueryParams are included in request when no other query parameters exist",
protocol: "aws.protocols#restJson1",
method: "GET",
uri: "/http-query-params-only",
queryParams: ["shouldExpandRoles=true", "shouldShowOnlyAuthForThisDocument=false"],
params: {
queryMap: {
"shouldExpandRoles": "true",
"shouldShowOnlyAuthForThisDocument": "false"
}
},
appliesTo: "client",
},
{
id: "HttpQueryParamsOnlyEmptyRequest",
documentation: "Test that empty httpQueryParams map results in no query parameters",
protocol: "aws.protocols#restJson1",
method: "GET",
uri: "/http-query-params-only",
params: {
queryMap: {}
},
appliesTo: "client",
}
])
operation HttpQueryParamsOnlyOperation {
input: HttpQueryParamsOnlyInput,
}

structure HttpQueryParamsOnlyInput {
@httpQueryParams
queryMap: QueryMap,
}

map QueryMap {
key: String,
value: String,
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ private val allowedClippyLints =
"result_large_err",
// Difficult to avoid in generated code
"unnecessary_map_on_constructor",
// Introduced by Python server codegen but needs to be suppressed for regular codegen (https://github.com/smithy-lang/smithy-rs/pull/4537)
"useless_conversion",
// Service models can specify a date, such as 2024-01-08, as the "since" date for deprecation.
"deprecated_semver",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ open class EventStreamMarshallerGenerator(
is BlobShape -> "ByteArray($inputName.into_inner().into())"
is EnumShape -> "String($inputName.to_string().into())"
is StringShape -> "String($inputName.into())"
is TimestampShape -> "Timestamp($inputName)"
is TimestampShape -> "Timestamp($inputName.into())"
else -> throw IllegalStateException("unsupported event stream header shape type: $target")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@ fun String.asSmithyModel(
sourceLocation: String? = null,
smithyVersion: String = SMITHY_VERSION,
disableValidation: Boolean = false,
additionalDeniedModels: Array<String> = emptyArray(),
): Model {
val processed = letIf(!this.trimStart().startsWith("\$version")) { "\$version: ${smithyVersion.dq()}\n$it" }
val denyModelsContaining =
arrayOf(
// If Smithy protocol test models are in our classpath, don't load them, since they are fairly large and we
// almost never need them.
"smithy-protocol-tests",
)
) + additionalDeniedModels
val urls =
ModelDiscovery.findModels().filter { modelUrl ->
denyModelsContaining.none {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class SmithyTypesPubUseExtraTest {
input: SomeInput,
output: SomeOutput
}
""".asSmithyModel()
""".asSmithyModel(
// Filters out models containing `smithy.test#EventHeaderValue` to avoid pulling in
// blob and timestamp types, which would defeat the purpose of this test.
additionalDeniedModels = arrayOf("smithy-protocol-test-traits"),
)
}

private fun initialize(model: Model): Pair<CodegenContext, RustCrate> {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlin-version = "2.1.0"
ktlint-version = "1.0.1"

# codegen
smithy-version = "1.63.0"
smithy-version = "1.67.0"
smithy-gradle-plugin-version = "1.3.0"

# publishing
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions rust-runtime/aws-smithy-http-server-python/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ impl From<aws_smithy_types::DateTime> for DateTime {
}
}

impl From<DateTime> for aws_smithy_types::DateTime {
fn from(other: DateTime) -> aws_smithy_types::DateTime {
other.0
}
}

impl Deref for DateTime {
type Target = aws_smithy_types::DateTime;

Expand Down
Loading