Nov 30, 2021
I assume you're using kotlinx.serialization: https://stackoverflow.com/questions/64319112/why-serializing-collections-of-different-element-types-is-not-supported-in-ktor. kotlinx.serialization doesn't support serialization of different types because it does its magic at compile time (unlike e.g. GSON that uses runtime type information).