File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,17 @@ private val logger = KotlinLogging.logger {}
1717
1818internal object ErrorCodeSerializer : KSerializer<ErrorCode> {
1919 override val descriptor: SerialDescriptor =
20- PrimitiveSerialDescriptor (" io.modelcontextprotocol.kotlin.sdk.ErrorCode" , PrimitiveKind .STRING )
20+ PrimitiveSerialDescriptor (" io.modelcontextprotocol.kotlin.sdk.ErrorCode" , PrimitiveKind .INT )
2121
2222 @OptIn(ExperimentalSerializationApi ::class )
2323 override fun serialize (encoder : Encoder , value : ErrorCode ) {
2424 encoder.encodeInt(value.code)
2525 }
2626
2727 override fun deserialize (decoder : Decoder ): ErrorCode {
28- val decodedString = decoder.decodeInt()
29- return ErrorCode .Defined .entries.firstOrNull { it.code == decodedString }
30- ? : ErrorCode .Unknown (decodedString )
28+ val decodedInt = decoder.decodeInt()
29+ return ErrorCode .Defined .entries.firstOrNull { it.code == decodedInt }
30+ ? : ErrorCode .Unknown (decodedInt )
3131 }
3232}
3333
You can’t perform that action at this time.
0 commit comments