Skip to content

Commit 0f716cf

Browse files
Fix the RAW content type
1 parent e500d13 commit 0f716cf

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

common/src/main/java/dev/restate/serde/Serde.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ public Slice serialize(byte[] value) {
153153
public byte[] deserialize(@NonNull Slice value) {
154154
return value.toByteArray();
155155
}
156+
157+
@Override
158+
public String contentType() {
159+
return "application/octet-stream";
160+
}
156161
};
157162

158163
/** Passthrough serializer/deserializer */

sdk-core/src/test/kotlin/dev/restate/sdk/core/kotlinapi/reflections/ReflectionDiscoveryTest.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ class ReflectionDiscoveryTest {
5353
@Test
5454
fun checkRawInputContentType() {
5555
assertThatDiscovery(RawInputOutput())
56-
.extractingService("RawInputOutput")
57-
.extractingHandler("rawInput")
58-
.extracting({ it.input }, type(Input::class.java))
59-
.extracting { it.contentType }
60-
.isEqualTo(Serde.RAW.contentType())
56+
.extractingService("RawInputOutput")
57+
.extractingHandler("rawInput")
58+
.extracting({ it.input }, type(Input::class.java))
59+
.extracting { it.contentType }
60+
.isEqualTo(Serde.RAW.contentType())
6161
}
6262

6363
@Test
6464
fun checkRawOutputContentType() {
6565
assertThatDiscovery(RawInputOutput())
66-
.extractingService("RawInputOutput")
67-
.extractingHandler("rawOutput")
68-
.extracting({ it.output }, type(Output::class.java))
69-
.extracting { it.contentType }
70-
.isEqualTo(Serde.RAW.contentType())
66+
.extractingService("RawInputOutput")
67+
.extractingHandler("rawOutput")
68+
.extracting({ it.output }, type(Output::class.java))
69+
.extracting { it.contentType }
70+
.isEqualTo(Serde.RAW.contentType())
7171
}
7272

7373
@Test

test-services/src/main/kotlin/dev/restate/sdk/testservices/interpreter.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ class ObjectInterpreterImpl(private val layer: Int) : ObjectInterpreter {
173173
}
174174
}
175175
is RecoverTerminalCallMaybeUnAwaited -> {
176-
val awaitable =
177-
toService<ServiceInterpreterHelper>().request { terminalFailure() }.call()
176+
val awaitable = toService<ServiceInterpreterHelper>().request { terminalFailure() }.call()
178177
promises[i] = { checkAwaitableFails(awaitable, i, cmd) }
179178
}
180179
is RejectAwakeable -> {

0 commit comments

Comments
 (0)