Skip to content

Commit d2b256c

Browse files
authored
fix: KMP JMESPath utils (#986)
1 parent 5ee5b75 commit d2b256c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

codegen/smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/KotlinSettingsTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package software.amazon.smithy.kotlin.codegen
77

8-
import org.junit.jupiter.api.assertThrows
98
import software.amazon.smithy.codegen.core.CodegenException
109
import software.amazon.smithy.kotlin.codegen.test.TestModelDefault
1110
import software.amazon.smithy.kotlin.codegen.test.toSmithyModel
@@ -284,7 +283,7 @@ class KotlinSettingsTest {
284283
}
285284
""".trimIndent()
286285

287-
assertThrows<IllegalArgumentException> {
286+
assertFailsWith<IllegalArgumentException> {
288287
KotlinSettings.from(
289288
model,
290289
Node.parse(contents).expectObjectNode(),

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package aws.smithy.kotlin.runtime.util
77

88
import aws.smithy.kotlin.runtime.InternalApi
9+
import kotlin.jvm.JvmName
910

1011
@InternalApi
1112
public fun Short.toNumber(): Short = this
@@ -64,3 +65,11 @@ public fun Any?.type(): String = when (this) {
6465
null -> "null"
6566
else -> throw Exception("Undetected type for: $this")
6667
}
68+
69+
@InternalApi
70+
@JvmName("noOpUnnestedCollection")
71+
public inline fun <reified T> Collection<T>.flattenIfPossible(): Collection<T> = this
72+
73+
@InternalApi
74+
@JvmName("flattenNestedCollection")
75+
public inline fun <reified T> Collection<Collection<T>>.flattenIfPossible(): Collection<T> = flatten()

runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/util/JMESPathJVM.kt

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)