https://kotlinlang.org logo
#serialization
Title
# serialization
g

ghedeon

01/31/2019, 1:35 PM
This prints `{"bar":"lorem"}`:
Copy code
@Serializable
	data class Foo(@Transient val bar: String)
	
	println(Json.stringify(Foo.serializer(), Foo("lorem")))
Do I miss anything about
@Transient
?
s

sandwwraith

01/31/2019, 6:01 PM
Probably you've imported kotlin.jvm.transient instead of kotlinx.serialization.Transient
👍 1
g

ghedeon

02/01/2019, 1:02 AM
that's correct, thank you. The other one is available globally, so there was no prompt for the import selection 😏
3 Views