Are they known bugs with sealed classes in 1.2.1 i...
# serialization
c
Are they known bugs with sealed classes in 1.2.1 in JS/JVM?
val data: Data
where
Data
is a sealed class gives me
Copy code
"data": {
	"type": "SIMPLE",
	"id": "TEXT"
}
on JS, and
Copy code
"data": [
	"SIMPLE",
	{
		"id": "TEXT"
	}
]
on JVM, which unsurprisingly completely fails when Ktor tries to send messages between them.
d
Did you enable arrayPolymorphism maybe?
c
After calling Json.encodeToString & decodeFromString manually from both sides (instead of letting Ktor do it), the problem is gone.
Maybe Ktor enabled that option? I definitely didn't explicitely enable anything
What is arrayPolymorphism? I can't find it in the wiki
Grr Ktor, Thanks Dominic you've got good intuition
👍🏼 1
j
I think ktor 1.6 somehow flipped the useArrayPolymorphism for the client: https://kotlinlang.slack.com/archives/C0A974TJ9/p1623504933235100
c
You just referenced my own thread to me ^^ But yeah, I posted here first, thanks to Dominic I understood it was Ktor's fault, and then posted in #ktor
j
hahaha I didn't notice
lets get another cup of coffee 😅