Hi, I am using kotlinx.serialization ContentNegoti...
# ktor
d
Hi, I am using kotlinx.serialization ContentNegotiation and my response have the following hierarchy:
Copy code
sealed class A () 
data class B(val name) : A()
data class C(val name): A()
My endpoint returns a List<A> and according to https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/polymorphism.md#sealed-classes I would expect the following format:
Copy code
[
  {
	"type": "com.A",
	"name": "name"
  }
]
And I am getting this format when Log the response object. Unfortunately, I got another response format when calling the endpoint:
Copy code
[
  [
	"com.A",
	{
	  "name": "name"
	}
  ]
]
Any ideas why this different format appears when responding with call.respond(object)?
i
I fixed same behavior by configuring arrayPolymorphism parameter for json configuration in install method. Unfortunately I don't have a laptop so I can't easily find a proper code snippet for this case
d
I added the configuration, but it didn't solve my problem
Now I fixed it. the value must be changed to false, wich is also the default of kotlinx.serialization in normal usage. Thank you for the hint.