File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types
commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ private fun JsonElement.getType(): String = requireNotNull(getTypeOrNull()) { "M
4444@Throws(SerializationException ::class )
4545private fun JsonElement.asJsonObject (): JsonObject {
4646 if (this !is JsonObject ) {
47- throw SerializationException (" Invalid response. JsonObject expected, got: $this " )
47+ throw SerializationException (" Invalid response. JsonObject expected, got: ${ this :: class .simpleName} " )
4848 }
4949 val jsonObject = this .jsonObject
5050 return jsonObject
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ class JsonRpcTest {
417417 McpJson .decodeFromString<JSONRPCMessage >(" [\" just a string\" ]" )
418418 }
419419
420- exception.message shouldBe " Invalid response. JsonObject expected, got: [ \" just a string \" ] "
420+ exception.message shouldBe " Invalid response. JsonObject expected, got: JsonArray "
421421 }
422422
423423 @Test
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class ResourcesTest {
259259 McpJson .decodeFromString<ResourceContents >(" \" just a string\" " )
260260 }
261261
262- exception.message shouldBe " Invalid response. JsonObject expected, got: \" just a string \" "
262+ exception.message shouldBe " Invalid response. JsonObject expected, got: JsonLiteral "
263263 }
264264
265265 @Test
You can’t perform that action at this time.
0 commit comments