bendb
10/04/2019, 4:54 PMNoClassDefFoundError
in Json.<clinit>
, which is indirectly trying to look up KPackage
, a kotlin-reflect type.
The test passes if I add a kotlin-reflect
dependency. Is it the case that json support requires kotlin-reflect?bendb
10/04/2019, 7:56 PMMap<KClass<*>, KSerializer<*>>
, which I believe does in fact require kotlin-reflect to materialize the entire KClass.groostav
10/04/2019, 10:31 PMKClass<T>
+ `value: String`into an instance of T
, given that you know T
is a reasonable value type (Double
, Int
, Enum
, or String
)?nimrod
10/09/2019, 7:58 PMMap<String, Any>
and one of the values contains a Date
instance. Is it possible to have a custom serializer in this case? In deserialize
method I don't know how to decode itNikky
10/12/2019, 5:19 PMShan
10/14/2019, 11:00 PMj.b.u: Can't locate argument-less serializer for class e.b.b.d.a (Kotlin reflection is not available). For generic classes, such as lists, please provide serializer explicitly.
Can anyone confirm that this means I have to write my own serializer because it's using a Map
? Or is there a way to do this that I'm missing somewhere? I'm using this with a Ktor request.ghedeon
10/21/2019, 11:54 AMkotlin.Result
class?
Let say I want to write a custom call adapter for Retrofit that wraps all my requests in Result
class. Right now serialization converter is failing with Can't locate argument-less serializer for class kotlin.Result
which sounds reasonable. How would one workaround this situation?Tyron Jung
10/21/2019, 7:09 PMJsonConfiguration(classDiscriminator = "customType")
work only for a particular class? For instance, let’s say I have something like:
@Serializable
data class MyClass(
@Polymorphic
val polymorphicA: PolymorphicA,
@Polymorphic
val polymorphicB: PolymorphicB
)
And I’m serializing/deserializing an instance of MyClass
. I want to serialize/deserialize polymorphicA
using the default classDiscriminator
which is type
. However, I want to serialize/deserialize polymorphicB
using a custom classDiscriminator
, say customType
. I don’t think the steps outlined in https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/polymorphism.md#a-bit-of-customizing showcase that level of granularity (i.e. if a custom classDiscriminator
is specified, it’s applied to all of MyClass
, which is not what I want).Marc Dietrichstein
10/22/2019, 12:09 PMribesg
10/23/2019, 9:44 AMShan
10/27/2019, 12:15 AMzjuhasz
10/28/2019, 9:08 PMRussell Cullen
11/01/2019, 2:31 PMDate?
from a String?
using a custom KSerializer<Date>
and it's working great, until the 3rd party API I'm using sends an empty string instead of null as expected. Is there a way to map this empty case to a null Date instead of a dummy-Date? It seems something like KSerializer<Date?>
is not supported, is that correct?altavir
11/01/2019, 5:35 PMaltavir
11/03/2019, 10:33 AM{
inside the object. What am I doing wrong?Davide Giuseppe Farella
11/07/2019, 2:19 AMe: java.lang.AssertionError: Recursion detected on input: IMPORT_DIRECTIVE under LockBasedStorageManager@160c4e98 (TopDownAnalyzer for JVM)
Ryan Benasutti
11/08/2019, 10:47 PMbitkid
11/12/2019, 10:43 AMMarc Reichelt
11/17/2019, 6:05 PMSlackbot
11/18/2019, 11:17 AMOvsyannikov Alexey
11/19/2019, 11:09 AMsandwwraith
11/19/2019, 1:11 PM0.14.0
has been released! This release contains some breaking changes and requires Kotlin 1.3.60 to work on all platforms. Some highlights:
• Support for tvOS and watchOS in all flavours (added in Kotlin/Native 1.3.60)
• Special support for serializing Kotlin's `object`s and sealed class
es. See updated docs: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/polymorphism.md#sealed-classes.
• Enums now should support @SerialName
and other specific annotations (but they should be marked @Serializable
).
Full changelog: https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md#v0140--2019-11-19turansky
11/20/2019, 6:56 PMobject
Is there any example on this theme?
What is use case for object
?toban
11/26/2019, 2:57 PM"amount":10.99
. How would i serialize a BigDecimal
or String
representation to a JSON number without any intermediate conversion to a floating point number?Ovsyannikov Alexey
11/27/2019, 7:29 AMMax Raskin
12/03/2019, 6:14 PMDavide Giuseppe Farella
12/04/2019, 8:26 AMDraftSource.build(actionId = 0, messageId = "id")
or also as DraftSource
is failing with Can't locate argument-less serializer for class
Geert
12/06/2019, 10:12 PMjava.lang.InstantiationError: kotlinx.serialization.KSerializer
error. Even when I use the Data(abc) nesting example from <https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/examples.md>Hullaballoonatic
12/07/2019, 12:51 AMMyEnumClass::serializer
?
should I annotate
@Serializable
enum class MyEnumClass { ... }
so that I can access it?Patrick Jackson
12/10/2019, 2:02 AMPatrick Jackson
12/10/2019, 2:02 AMSergei Dubrov [JB]
12/11/2019, 8:15 AMPatrick Jackson
12/11/2019, 9:03 PMminifyEnabled true
. I've tried setting proguard rules for the test apk but still no luck...still looking into it, but I don't think this is a kotlinx.serialization issue