Leonid Startsev

Results 510 comments of Leonid Startsev

I think it would be better solved by `kotlinx-io`. @fzhinkin Do you think we can already use it?

The problem with `ByteArray` is that you can't reliably make reasonable encoding API because you can't know array size in advance to allocate. And `ByteBuffer`s are JVM-only. `kotlinx-io` provides reasonable...

Related: #2165 On a side note: `the raw input should be kept and accessible fully. ` is likely unfeasible because inputs may be large and cause memory leaks

Since `decodeSequentially` skips calls to `decodeElementIndex` by design (https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization.encoding/-composite-decoder/decode-sequentially.html), it indeed cannot handle missing/optional data. Generally, it is your responsibility to decide whether input can be sequentially decoded or not,...

Essentially duplicate of #1182 / #2658. I agree that such an API is useful for schema generation, but it will have to many limitations and be very prone to breaking....

> Presumably the generated serializer is aware of the defaults in some way and can produce them when required, so it could look something like this (very pseudo-code): The difference...

Does ```kotlin Json { encodeDefaults = true explicitNulls = false } ``` achieve what you want?

> I want to add "null" for all values that do not have a default value set. Isn't this what `explicitNulls` do? > during decoding, the absence of a field...