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
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ atomicfu-version = "0.29.0"
binary-compatibility-validator-version = "0.18.0"

# smithy-kotlin codegen and runtime are versioned separately
smithy-kotlin-runtime-version = "1.5.15"
smithy-kotlin-codegen-version = "0.35.15"
smithy-kotlin-runtime-version = "1.5.16"
smithy-kotlin-codegen-version = "0.35.16"

# codegen
smithy-version = "1.62.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ class HttpEventStreamTests {
long = 9_000_000_000L
string = "a tay is a hammer"
timestamp = Instant.fromEpochSeconds(5)
enum = aws.sdk.kotlin.test.restjson1.model.Enum.fromValue("DIAMOND")
intEnum = IntEnum.fromValue(1)
},
)

Expand All @@ -204,6 +206,8 @@ class HttpEventStreamTests {
assertEquals(9_000_000_000L, headers["long"]?.expectInt64())
assertEquals("a tay is a hammer", headers["string"]?.expectString())
assertEquals(Instant.fromEpochSeconds(5), headers["timestamp"]?.expectTimestamp())
assertEquals(aws.sdk.kotlin.test.restjson1.model.Enum.fromValue("DIAMOND").value, headers["enum"]?.expectString())
assertEquals(IntEnum.fromValue(1).value, headers["intEnum"]?.expectInt32())

val deserialized = deserializedEvent(message)
assertIs<TestStream.MessageWithHeaders>(deserialized)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$version: "2"

namespace aws.sdk.kotlin.test

use aws.protocols#restJson1
Expand Down Expand Up @@ -54,6 +56,8 @@ structure MessageWithHeaders {
@eventHeader short: Short,
@eventHeader string: String,
@eventHeader timestamp: Timestamp,
@eventHeader enum: Enum,
@eventHeader intEnum: IntEnum,
}
structure MessageWithHeaderAndPayload {
@eventHeader header: String,
Expand Down Expand Up @@ -81,3 +85,18 @@ union TestStream {
MessageWithUnboundPayloadTraits: MessageWithUnboundPayloadTraits,
SomeError: SomeError,
}

enum Enum {
DIAMOND
CLUB
HEART
SPADE
}

intEnum IntEnum {
JACK = 1
QUEEN = 2
KING = 3
ACE = 4
JOKER = 5
}
Loading