We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the kotlinx.serialization plugin is applied the build fails with a recursion error for the following class:
kotlinx.serialization
@Serializable class Base64ByteArray(val value: ByteArray) { @Serializer(Base64ByteArray::class) companion object : KSerializer<Base64ByteArray> { override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.decodeToString()) override fun deserialize(decoder: Decoder) = Base64ByteArray(decoder.decodeString().encodeToByteArray()) } override fun equals(other: Any?): Boolean { if (this === other) return true if (other == null || this::class != other::class) return false other as Base64ByteArray return value.contentEquals(other.value) } override fun hashCode(): Int { return value.contentHashCode() } override fun toString(): String { return "Base64ByteArray(${value})" } }
Also see #23 (comment).
The text was updated successfully, but these errors were encountered:
@GrahamBorland explicitly specifying the return type of descriptor will "fix" the build:
descriptor
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
Sorry, something went wrong.
Merge branch 'master' into issues/GH-27
25098e8
Fix recursion error with kotlinx.serialization #27
92f9a24
Merge pull request #28 from rickclephas/issues/GH-27
e222573
Fix recursion error with kotlinx.serialization
rickclephas
Successfully merging a pull request may close this issue.
When the
kotlinx.serialization
plugin is applied the build fails with a recursion error for the following class:Also see #23 (comment).
The text was updated successfully, but these errors were encountered: