thevery
12/20/2018, 9:31 PMerror: compilation failed: Unable to resolve exported type ExternalType(hash='8694429315213666092', name='kotlinx.serialization.KSerializer')
Nikky
12/24/2018, 9:03 PM@Comment("what the thing does")
on a filed
and Json(enableComments = true)
to allow parsing and serializing themNikky
12/25/2018, 1:01 AMSerialClassDescImpl
rather throws a MissingDescriptorException
than returning a StringDescriptor
Alexander
12/25/2018, 7:40 AMkotlinx.serialization.json.Parser
public? I want to parse json stream and there are jvm-only solutions. Think it would be nice to have multiplatform streaming parser.serebit
12/25/2018, 4:38 PMrrader
12/26/2018, 1:57 PMrrader
12/26/2018, 2:25 PMrrader
12/30/2018, 7:42 PMqlitzler
12/31/2018, 1:56 AM{ "myKey": true } // First server response
{ "myKey": "someValue" } // Second server response
I don't know in advance what kind of type the value will be, so I came up with this solution. I would like your professional opinion: Is there a better way to do it ? Can it be improved ?
If you find it alright, I'm leaving the code snippet for those who might run into the same use case.qlitzler
12/31/2018, 2:08 AMjava.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 outputserebit
01/08/2019, 10:06 PMNikky
01/09/2019, 10:08 PMNikky
01/11/2019, 12:23 AM@Serializable
has this function to get its serializerthevery
01/13/2019, 2:35 PMalexfacciorusso
01/14/2019, 9:48 AMJoakimForslund
01/17/2019, 11:04 AMnikolaymetchev
01/17/2019, 1:07 PM@Serializable(with = ...)
work at the top level @Serializer(forClass = CustomData::class)
class CustomDataSerializer : KSerializer<CustomData> {...
}
@Serializable(with = CustomDataSerializer::class)
data class CustomData(val data: String)
fun m() {
val x: KSerializer<CustomData> = CustomData.serializer() // this doesn't compile
}
charleskorn
01/20/2019, 10:02 PMAshley Figueira
01/22/2019, 9:51 AMDavide Giuseppe Farella
01/22/2019, 2:41 PM@ImplicitReflectionSerializer
to spread all over my codebase like a cancer? 😅thevery
01/23/2019, 10:24 PMNikky
01/24/2019, 4:44 AMsandwwraith
01/24/2019, 9:51 AMv0.10.0
has been released! This release is binary compatible with Kotlin/Native 1.3.20. Important highlights and breaking changes:
• Gradle metadata version was bumped to 0.4, so you need to upgrade Gradle in your project to 4.8 or higher (recommended is 4.10) to be able to resolve K/N dependencies
• Maven serialization plugin coordinates were changed to match other compiler maven plugins. Now it is `kotlin-maven-serialization`: https://search.maven.org/artifact/org.jetbrains.kotlin/kotlin-maven-serialization/1.3.20/jar. Issue with Maven import (https://github.com/Kotlin/kotlinx.serialization/issues/307) has also been resolved.
• This release contains all changes from 0.10.0-eap-1, including JSON->Json renaming, ability to skip default values, ability to inspect descriptors tree, and almost feature-full compiler plugin for Kotlin Native.
Full changelog: https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md#0100--2019-01-22Nikky
01/24/2019, 9:10 PMJson
replacing JSON
i cannot com;ile any dependency using 0.9.1 with my program using 0.10.0JoakimForslund
01/28/2019, 8:44 AMjava.lang.IllegalStateException: Backend Internal error: Exception during code generation
Cause: Back-end (JVM) Internal error: Serializer for element of type HashMap<String, String> has not been found.
To use context serializer as fallback, explicitly annotate element with @ContextualSerializer
Since the latest serialization_version=0.10.0
Two things, there seems to be no annotation called @ContextualSerializer
to import, there is a @ContextualSerialization
however.
Using the latter before the HashMap seems to give:
No direct method <init>(Lkotlin/reflect/KClass;Lkotlinx/serialization/KSerializer;Lkotlinx/serialization/KSerializer;)V in class Lkotlinx/serialization/ContextSerializer; or its super classes (declaration of 'kotlinx.serialization.ContextSerializer'
Any ideas?josephivie
01/28/2019, 8:13 PMhallvard
01/29/2019, 3:35 PMjosephivie
01/30/2019, 7:35 AMencodeBytes()
and decodeBytes()
? Kotlin type ByteArray
?
Or is this something that is deliberately left out of the library?Mate
01/30/2019, 12:58 PM@Serializable
data class Foo(
val a: String,
val b: List<String>
)
I'd like to handle read/write asymmetrically in this case (using JSON):
- For read I'd like to read both a and b properties from json string
- For write however I'd like to serialize only b to json string
I've tried the Mapper to convert this to a map remove the unwanted key, but then I could not find a way to serialize the Map<String, Any>
What do you think would be the best solution for this case?
Something like @Transient(In|Out|InOut) would be great 🙂jw
01/31/2019, 4:37 AM