diff --git a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt index 2f54b95a..f3e0f65f 100644 --- a/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt +++ b/core/api/src/commonMain/kotlin/dev/inmo/postssystem/core/content/Content.kt @@ -1,10 +1,7 @@ package dev.inmo.postssystem.core.content -import dev.inmo.micro_utils.common.ByteArrayAllocator -import dev.inmo.micro_utils.common.ByteArrayAllocatorSerializer -import dev.inmo.micro_utils.mime_types.KnownMimeTypes -import dev.inmo.micro_utils.mime_types.MimeType import kotlinx.serialization.Serializable +import kotlinx.serialization.modules.* typealias ContentId = String @@ -23,6 +20,14 @@ data class OtherContentLinkContent( ) : Content +fun SerializersModuleBuilder.includeContentsSerializers( + block: PolymorphicModuleBuilder.() -> Unit +) { + polymorphic(Content::class) { + subclass(OtherContentLinkContent::class, OtherContentLinkContent.serializer()) + block() + } +} /** * Content which is already registered in database. Using its [id] you can retrieve all known