diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt index 6604ea15f..ff129c427 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt @@ -68,7 +68,7 @@ public fun Any?.type(): String = when (this) { is Boolean -> "boolean" is List<*>, is Array<*> -> "array" is Short, is Int, is Long, is Float, is Double -> "number" - is HashMap<*, *>, is Any -> "object" + is Any -> "object" null -> "null" else -> throw Exception("Undetected type for: $this") } diff --git a/tests/codegen/waiter-tests/model/function-type.smithy b/tests/codegen/waiter-tests/model/function-type.smithy index ba7eb2d34..0d88d1daf 100644 --- a/tests/codegen/waiter-tests/model/function-type.smithy +++ b/tests/codegen/waiter-tests/model/function-type.smithy @@ -11,9 +11,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.string) == types.string", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.string)", + expected: "string", + comparator: "stringEquals" } } } @@ -25,9 +25,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.boolean) == types.boolean", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.boolean)", + expected: "boolean", + comparator: "stringEquals" } } } @@ -39,9 +39,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(lists.booleans) == types.array", - expected: "true", - comparator: "booleanEquals" + path: "type(lists.booleans)", + expected: "array", + comparator: "stringEquals" } } } @@ -53,9 +53,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.short) == types.number", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.short)", + expected: "number", + comparator: "stringEquals" } } } @@ -67,9 +67,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.integer) == types.number", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.integer)", + expected: "number", + comparator: "stringEquals" } } } @@ -81,9 +81,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.long) == types.number", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.long)", + expected: "number", + comparator: "stringEquals" } } } @@ -95,9 +95,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.float) == types.number", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.float)", + expected: "number", + comparator: "stringEquals" } } } @@ -109,9 +109,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.double) == types.number", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.double)", + expected: "number", + comparator: "stringEquals" } } } @@ -123,9 +123,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives) == types.objectType", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives)", + expected: "object", + comparator: "stringEquals" } } } @@ -137,9 +137,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(merge(primitives, primitives)) == types.objectType", - expected: "true", - comparator: "booleanEquals" + path: "type(merge(primitives, primitives))", + expected: "object", + comparator: "stringEquals" } } } @@ -151,9 +151,9 @@ use smithy.waiters#waitable state: "success", matcher: { output: { - path: "type(primitives.boolean) == types.nullType", - expected: "true", - comparator: "booleanEquals" + path: "type(primitives.boolean)", + expected: "null", + comparator: "stringEquals" } } } diff --git a/tests/codegen/waiter-tests/model/utils/structures.smithy b/tests/codegen/waiter-tests/model/utils/structures.smithy index 351b98ac9..77615d5b1 100644 --- a/tests/codegen/waiter-tests/model/utils/structures.smithy +++ b/tests/codegen/waiter-tests/model/utils/structures.smithy @@ -21,7 +21,6 @@ structure GetEntityResponse { sampleValues: Values, objectOne: Values, objectTwo: Values, - types: Types, } structure EntityPrimitives { @@ -173,12 +172,3 @@ structure Values { valueTwo: String valueThree: String } - -structure Types { - string: String - boolean: String - array: String - number: String - objectType: String - nullType: String -} diff --git a/tests/codegen/waiter-tests/src/test/kotlin/com/test/FunctionTypeTest.kt b/tests/codegen/waiter-tests/src/test/kotlin/com/test/FunctionTypeTest.kt index 55e15b7df..e5d772c80 100644 --- a/tests/codegen/waiter-tests/src/test/kotlin/com/test/FunctionTypeTest.kt +++ b/tests/codegen/waiter-tests/src/test/kotlin/com/test/FunctionTypeTest.kt @@ -5,7 +5,10 @@ package com.test -import com.test.model.* +import com.test.model.EntityLists +import com.test.model.EntityPrimitives +import com.test.model.GetFunctionTypeEqualsRequest +import com.test.model.GetFunctionTypeEqualsResponse import com.test.utils.successTest import com.test.waiters.* import kotlin.test.Test @@ -16,11 +19,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionStringEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { string = "foo" } - types = Types { string = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { string = "foo" } - types = Types { string = "string" } }, ) @@ -29,11 +27,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionBooleanEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { boolean = true } - types = Types { boolean = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { boolean = true } - types = Types { boolean = "boolean" } }, ) @@ -42,11 +35,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionArrayEquals, GetFunctionTypeEqualsResponse { lists = EntityLists { booleans = listOf(true) } - types = Types { array = "foo" } - }, - GetFunctionTypeEqualsResponse { - lists = EntityLists { booleans = listOf(true) } - types = Types { array = "array" } }, ) @@ -55,11 +43,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionShortEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { short = 1 } - types = Types { number = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { short = 1 } - types = Types { number = "number" } }, ) @@ -68,11 +51,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionIntegerEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { integer = 1 } - types = Types { number = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { integer = 1 } - types = Types { number = "number" } }, ) @@ -81,11 +59,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionLongEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { long = 1L } - types = Types { number = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { long = 1L } - types = Types { number = "number" } }, ) @@ -94,11 +67,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionFloatEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { float = 1f } - types = Types { number = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { float = 1f } - types = Types { number = "number" } }, ) @@ -107,11 +75,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionDoubleEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { double = 1.0 } - types = Types { number = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { double = 1.0 } - types = Types { number = "number" } }, ) @@ -120,11 +83,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionObjectEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { } - types = Types { objectType = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { } - types = Types { objectType = "object" } }, ) @@ -133,11 +91,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionMergedObjectEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { } - types = Types { objectType = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { } - types = Types { objectType = "object" } }, ) @@ -146,11 +99,6 @@ class FunctionTypeTest { WaitersTestClient::waitUntilTypeFunctionNullEquals, GetFunctionTypeEqualsResponse { primitives = EntityPrimitives { boolean = null } - types = Types { nullType = "foo" } - }, - GetFunctionTypeEqualsResponse { - primitives = EntityPrimitives { boolean = null } - types = Types { nullType = "null" } }, ) }