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

qlitzler

12/31/2018, 2:08 AM
Also, I found something interesting. I initially wrote the test like this (see code snippet attached), but it failed with the following error message:
Copy code
java.lang.AssertionError: 
Expected :{"primitive": 0}
Actual   :{"primitive":0}
As you can see, there's an additional space between the semicolon and the value when I serialize the json using
json { "primitive" to 0 }.toString()
, compared to
JSON.stringify(serializer, obj)
. Is this intentional ? It seems to me that both should have the exact same output
v

Vsevolod Tolstopyatov [JB]

01/09/2019, 4:12 PM
Is this intentional?
Not really. Filed https://github.com/Kotlin/kotlinx.serialization/issues/323
3 Views