package dev.inmo.postssystem.services.posts.common

import kotlinx.serialization.SerialFormat
import kotlinx.serialization.cbor.Cbor
import kotlinx.serialization.modules.*

const val postsRootPath = "posts"
const val postsCreateTempPathPart = "temp"

const val postsPostIdParameter = "postId"

fun SerialFormat.createWithSerializerModuleExtension(
    configurator: SerializersModuleBuilder.() -> Unit
) = Cbor {
    serializersModule = this@createWithSerializerModuleExtension.serializersModule.overwriteWith(
        SerializersModule {
            include(this@createWithSerializerModuleExtension.serializersModule)
            configurator()
        }
    )
}
