Skip to content
Draft
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 @@ -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.62.0"
smithy-version = "1.64.0"
smithy-gradle-plugin-version = "1.3.0"

# publishing
Expand Down
Loading