# Libraries

**URL:** https://discuss.kotlinlang.org/c/libraries/11.md?page=2

[Latest](https://discuss.kotlinlang.org/latest.md) · [Categories](https://discuss.kotlinlang.org/categories.md)

**Page:** 3

---

## [Ktor: Serializer for class 'JsonLiteral' is not found](https://discuss.kotlinlang.org/t/ktor-serializer-for-class-jsonliteral-is-not-found/26880)

<div class="topic-metadata">

**Author:** [@Psijic](https://discuss.kotlinlang.org/u/Psijic)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 11:58am UTC](https://discuss.kotlinlang.org/t/ktor-serializer-for-class-jsonliteral-is-not-found/26880 "2023-06-01T11:58:51Z")

</div>

Recently updated my Ktor from 1.6 to 2.3.0 and some requests work fine but others have this error: Serializer for class ‘JsonLiteral’ is not found. Please ensure that class is marked as ‘@Serializable’ and that the s…

---

## [Why is MapWithDefault private?](https://discuss.kotlinlang.org/t/why-is-mapwithdefault-private/26861)

<div class="topic-metadata">

**Author:** [@Mamut](https://discuss.kotlinlang.org/u/Mamut)\
**Replies:** 1\
**Last updated:** [May 25, 2023, 4:44pm UTC](https://discuss.kotlinlang.org/t/why-is-mapwithdefault-private/26861 "2023-05-25T16:44:27Z")

</div>

I like to use .withDefault on maps. Today I wanted to write a class containing some mapping of values and wanted to be sure every instance of such class will also define a default mapping. Example of such mapping: mapOf…

---

## [\[Kotlinx.html\] Library Updates](https://discuss.kotlinlang.org/t/kotlinx-html-library-updates/26761)

<div class="topic-metadata">

**Author:** [@severne](https://discuss.kotlinlang.org/u/severne)\
**Replies:** 1\
**Last updated:** [May 16, 2023, 12:00pm UTC](https://discuss.kotlinlang.org/t/kotlinx-html-library-updates/26761 "2023-05-16T12:00:14Z")

</div>

What’s the status of the Kotlinx.html library? According to its releases page on the Github repo, it’s been almost ten months since the last release of 0.8.0, and there hasn’t been a merge to master since December.

---

## [\[kotlinx.html\] Reusable component without extra div](https://discuss.kotlinlang.org/t/kotlinx-html-reusable-component-without-extra-div/26575)

<div class="topic-metadata">

**Author:** [@KX](https://discuss.kotlinlang.org/u/KX)\
**Replies:** 4\
**Last updated:** [March 27, 2023, 9:47pm UTC](https://discuss.kotlinlang.org/t/kotlinx-html-reusable-component-without-extra-div/26575 "2023-03-27T21:47:43Z")

</div>

I’m looking for an effective solution to create reusable components in kotlinx.html. I found three type of solutions, but each result in unwanted side effects, such as being 100x slower, or unwanted extra divs. This is …

---

## [Resources for Ktor - Any suggestions?](https://discuss.kotlinlang.org/t/resources-for-ktor-any-suggestions/26531)

<div class="topic-metadata">

**Author:** [@mjovanc](https://discuss.kotlinlang.org/u/mjovanc)\
**Replies:** 1\
**Last updated:** [March 17, 2023, 9:25am UTC](https://discuss.kotlinlang.org/t/resources-for-ktor-any-suggestions/26531 "2023-03-17T09:25:28Z")

</div>

I don’t know if I can post here. But I just wanted to share with Kotlin developers that I’m trying to put together a GitHub repo to collect good resources for Ktor developers. I’m continuously adding good links I can fin…

---

## [My experience with "select" in coroutines](https://discuss.kotlinlang.org/t/my-experience-with-select-in-coroutines/26475)

<div class="topic-metadata">

**Author:** [@frizzil](https://discuss.kotlinlang.org/u/frizzil)\
**Replies:** 6\
**Last updated:** [March 13, 2023, 12:44am UTC](https://discuss.kotlinlang.org/t/my-experience-with-select-in-coroutines/26475 "2023-03-13T00:44:53Z")

</div>

Hi folks, I wanted to talk a little about my experience with coroutine select in the context of a game engine. First of all, I’m very happy that it exists in Kotlin! Coroutines are so incredibly useful, and there’s so m…

---

## [Coroutines for game scripting, technical questions](https://discuss.kotlinlang.org/t/coroutines-for-game-scripting-technical-questions/26216)

<div class="topic-metadata">

**Author:** [@frizzil](https://discuss.kotlinlang.org/u/frizzil)\
**Replies:** 10\
**Last updated:** [March 13, 2023, 12:34am UTC](https://discuss.kotlinlang.org/t/coroutines-for-game-scripting-technical-questions/26216 "2023-03-13T00:34:37Z")

</div>

Context: I’m developing a scripting API for my game engine, such that scripts can be “suspended” across multiple game frames for an intuitive flow, thus avoiding implementation of numerous tedious state machines, “comman…

---

## [File vs Path in Kotlin](https://discuss.kotlinlang.org/t/file-vs-path-in-kotlin/26349)

<div class="topic-metadata">

**Author:** [@thumannw](https://discuss.kotlinlang.org/u/thumannw)\
**Replies:** 4\
**Last updated:** [February 13, 2023, 10:11pm UTC](https://discuss.kotlinlang.org/t/file-vs-path-in-kotlin/26349 "2023-02-13T22:11:33Z")

</div>

I think there is the consensus that, nowadays, Path should be used instead of File in Java code. But what about Kotlin? Kotlin has some nice extension functions on File which make it more usable than in plain Java. Somet…

---

## [How to get declaring KtFile/KtClass using KtCallExpression?](https://discuss.kotlinlang.org/t/how-to-get-declaring-ktfile-ktclass-using-ktcallexpression/26271)

<div class="topic-metadata">

**Author:** [@tmvkrpxl0](https://discuss.kotlinlang.org/u/tmvkrpxl0)\
**Replies:** 1\
**Last updated:** [January 25, 2023, 5:45am UTC](https://discuss.kotlinlang.org/t/how-to-get-declaring-ktfile-ktclass-using-ktcallexpression/26271 "2023-01-25T05:45:20Z")

</div>

I’m using Kotlin compiler to analyze kotlin source file. I need to get enclosing element that defines function of KtCallExpression For example, If I have this in a file called Main.kt: fun main() { f1() Test.f2…

---

## [Custom function to update data in pending kotlin channel buffer](https://discuss.kotlinlang.org/t/custom-function-to-update-data-in-pending-kotlin-channel-buffer/26204)

<div class="topic-metadata">

**Author:** [@venkat](https://discuss.kotlinlang.org/u/venkat)\
**Replies:** 4\
**Last updated:** [January 15, 2023, 12:13am UTC](https://discuss.kotlinlang.org/t/custom-function-to-update-data-in-pending-kotlin-channel-buffer/26204 "2023-01-15T00:13:17Z")

</div>

I have an UNLIMITED size buffered channel where senders are much faster than receivers. I would like to update the buffer by removing old data and replacing it with newer one (if the receiver does not yet consume it) He…

---

## [Factorial in the library?](https://discuss.kotlinlang.org/t/factorial-in-the-library/1811)

<div class="topic-metadata">

**Author:** [@Russel](https://discuss.kotlinlang.org/u/Russel)\
**Replies:** 7\
**Last updated:** [January 9, 2023, 9:50am UTC](https://discuss.kotlinlang.org/t/factorial-in-the-library/1811 "2023-01-09T09:50:49Z")

</div>

Trying to do combinatorics, factorial is really rather essential. Yes it can be calculated using reduce. However given there is a sum function in the library shouldn’t there be a product function.

---

## [Kotlin ecosystem and utilities](https://discuss.kotlinlang.org/t/kotlin-ecosystem-and-utilities/26121)

<div class="topic-metadata">

**Author:** [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Replies:** 0\
**Last updated:** [December 20, 2022, 1:07am UTC](https://discuss.kotlinlang.org/t/kotlin-ecosystem-and-utilities/26121 "2022-12-20T01:07:51Z")

</div>

Hello everyone, after long time researching Kotlin, I have discovered that there are many neat solutions to things, but that they are locked into the JetBrains components/frameworks. Currently I have seen the lack of un…

---

## [Quesion about ConcurrentMap.getOrPut](https://discuss.kotlinlang.org/t/quesion-about-concurrentmap-getorput/13539)

<div class="topic-metadata">

**Author:** [@kobe2000](https://discuss.kotlinlang.org/u/kobe2000)\
**Replies:** 7\
**Last updated:** [December 14, 2022, 7:21pm UTC](https://discuss.kotlinlang.org/t/quesion-about-concurrentmap-getorput/13539 "2022-12-14T19:21:48Z")

</div>

Hi, I have a question about ConcurrentMap.getOrPut function. How could it happen that but the \[defaultValue\] function may be invoked even if the key is already in the map? /\*\* \* Concurrent getOrPut, that is safe for …

---

## [The latest state of my kotlin framework after interacting with the first users](https://discuss.kotlinlang.org/t/the-latest-state-of-my-kotlin-framework-after-interacting-with-the-first-users/26050)

<div class="topic-metadata">

**Author:** [@babyfish-ct](https://discuss.kotlinlang.org/u/babyfish-ct)\
**Replies:** 0\
**Last updated:** [December 8, 2022, 3:52am UTC](https://discuss.kotlinlang.org/t/the-latest-state-of-my-kotlin-framework-after-interacting-with-the-first-users/26050 "2022-12-08T03:52:53Z")

</div>

A few months ago, I completed an ORM and cache manager called Jimmer for Java and Kotlin. After frequent interactions with more than a hundred first users in a private chat room, I made many improvements, including more …

---

## [Pair should implement Map.Entry](https://discuss.kotlinlang.org/t/pair-should-implement-map-entry/11917)

<div class="topic-metadata">

**Author:** [@TrombaMarina](https://discuss.kotlinlang.org/u/TrombaMarina)\
**Replies:** 15\
**Last updated:** [December 4, 2022, 4:22pm UTC](https://discuss.kotlinlang.org/t/pair-should-implement-map-entry/11917 "2022-12-04T16:22:27Z")

</div>

// Here's a pair: val cToC: Pair\<String, Char\> = "C" to 'c' // Maps are constructed with pairs: val m: Map\<String, Char\> = mapOf("A" to 'a', "B" to 'b', cToC) // Inputs are pairs, bu…

---

## [Is there a multiplatform calendar library, or new functionality in kotlinx.datetime to get number of days in a month?](https://discuss.kotlinlang.org/t/is-there-a-multiplatform-calendar-library-or-new-functionality-in-kotlinx-datetime-to-get-number-of-days-in-a-month/25997)

<div class="topic-metadata">

**Author:** [@crg7475](https://discuss.kotlinlang.org/u/crg7475)\
**Replies:** 1\
**Last updated:** [November 30, 2022, 1:27pm UTC](https://discuss.kotlinlang.org/t/is-there-a-multiplatform-calendar-library-or-new-functionality-in-kotlinx-datetime-to-get-number-of-days-in-a-month/25997 "2022-11-30T13:27:07Z")

</div>

I have code that could benefit from knowing how many days a given month has. This is not as trivial as it may sound; every 4 years, February has 29 days instead of 28 for example. And throughout history, there have been …

---

## [I/O Streams for Kotlin](https://discuss.kotlinlang.org/t/i-o-streams-for-kotlin/9802)

<div class="topic-metadata">

**Author:** [@akornilov82](https://discuss.kotlinlang.org/u/akornilov82)\
**Replies:** 23\
**Last updated:** [November 22, 2022, 8:58am UTC](https://discuss.kotlinlang.org/t/i-o-streams-for-kotlin/9802 "2022-11-22T08:58:10Z")

</div>

I would like to start from thanking all Kotlin creators! :slight\_smile: I have read “Kotlin in Action” book and it best book about programming that I read recently! Thanks a lot for authors of this book! Since this su…

---

## [What is the execution order of suspended functions?](https://discuss.kotlinlang.org/t/what-is-the-execution-order-of-suspended-functions/25984)

<div class="topic-metadata">

**Author:** [@fedorov1984](https://discuss.kotlinlang.org/u/fedorov1984)\
**Replies:** 2\
**Last updated:** [November 21, 2022, 6:48pm UTC](https://discuss.kotlinlang.org/t/what-is-the-execution-order-of-suspended-functions/25984 "2022-11-21T18:48:16Z")

</div>

I am puzzled by how code with coroutines is executed: import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking fun main() { runBlocking { launch { p…

---

## [Is there a way to get from KProperty0 to KProperty1?](https://discuss.kotlinlang.org/t/is-there-a-way-to-get-from-kproperty0-to-kproperty1/25933)

<div class="topic-metadata">

**Author:** [@knolle](https://discuss.kotlinlang.org/u/knolle)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 8:17am UTC](https://discuss.kotlinlang.org/t/is-there-a-way-to-get-from-kproperty0-to-kproperty1/25933 "2022-11-09T08:17:16Z")

</div>

I cannot find a way to get from an instance-bound property to the respective class property, e.g. from ::myVal to MyClass::myVal. I feel, that this should be possible since ::myVal is just a specialized case of MyClass:…

---

## [Finally, the kotlin API and External Cache are supported, and my ORM is finished](https://discuss.kotlinlang.org/t/finally-the-kotlin-api-and-external-cache-are-supported-and-my-orm-is-finished/25533)

<div class="topic-metadata">

**Author:** [@babyfish-ct](https://discuss.kotlinlang.org/u/babyfish-ct)\
**Replies:** 0\
**Last updated:** [August 26, 2022, 4:44am UTC](https://discuss.kotlinlang.org/t/finally-the-kotlin-api-and-external-cache-are-supported-and-my-orm-is-finished/25533 "2022-08-26T04:44:34Z")

</div>

Hi Guys It’s been a few more months since the last message, my ORM is completely finished, with two important changes. Kotlin API is supported, all the code snippets in the documentation become tab containing 2 cards:…

---

## [Returning instances from Kotlin scripts, storing them in a map, then executing methods on those instances to front-load the performance cost?](https://discuss.kotlinlang.org/t/returning-instances-from-kotlin-scripts-storing-them-in-a-map-then-executing-methods-on-those-instances-to-front-load-the-performance-cost/25522)

<div class="topic-metadata">

**Author:** [@carlislefox](https://discuss.kotlinlang.org/u/carlislefox)\
**Replies:** 1\
**Last updated:** [August 25, 2022, 7:15am UTC](https://discuss.kotlinlang.org/t/returning-instances-from-kotlin-scripts-storing-them-in-a-map-then-executing-methods-on-those-instances-to-front-load-the-performance-cost/25522 "2022-08-25T07:15:49Z")

</div>

Hello everyone, this is my first post here so be gentle :slight\_smile: This isn’t a request for support as such, as I have something that seems really great working. This is more of a… journey of further understanding. …

---

## [Best Practices Testing Coroutines With Delays?](https://discuss.kotlinlang.org/t/best-practices-testing-coroutines-with-delays/25303)

<div class="topic-metadata">

**Author:** [@ewingsan](https://discuss.kotlinlang.org/u/ewingsan)\
**Replies:** 0\
**Last updated:** [July 27, 2022, 7:50pm UTC](https://discuss.kotlinlang.org/t/best-practices-testing-coroutines-with-delays/25303 "2022-07-27T19:50:14Z")

</div>

If I want to test a function that launches coroutine that has a delay, what are the best practices for testing that function? Is it to use advanceUntilIdle(), advanceTimeBy(), something else, or some combination dependin…

---

## [Is it possible to make the usage of KSP easier?](https://discuss.kotlinlang.org/t/is-it-possible-to-make-the-usage-of-ksp-easier/25258)

<div class="topic-metadata">

**Author:** [@babyfish-ct](https://discuss.kotlinlang.org/u/babyfish-ct)\
**Replies:** 1\
**Last updated:** [July 28, 2022, 4:56am UTC](https://discuss.kotlinlang.org/t/is-it-possible-to-make-the-usage-of-ksp-easier/25258 "2022-07-28T04:56:47Z")

</div>

Now, I’m adding kotlin-api to my framework. The existing java-api uses annotation processor, the user gradle code looks like this annotationProcessor(project("org.babyfish.jimmer:jimmer-apt:0.0.35")) it’s very simple,…

---

## [\[reflect\] Extend API to get parents/owners](https://discuss.kotlinlang.org/t/reflect-extend-api-to-get-parents-owners/25270)

<div class="topic-metadata">

**Author:** [@broot](https://discuss.kotlinlang.org/u/broot)\
**Replies:** 0\
**Last updated:** [July 23, 2022, 1:59pm UTC](https://discuss.kotlinlang.org/t/reflect-extend-api-to-get-parents-owners/25270 "2022-07-23T13:59:19Z")

</div>

Are there any plans to extend the reflection API with possibility to go from children to parents, e.g. from function to class/package? I think the biggest limitation of the reflection right now is that KFunction and KPr…

---

## [Open overriden properties serialization](https://discuss.kotlinlang.org/t/open-overriden-properties-serialization/25254)

<div class="topic-metadata">

**Author:** [@milty](https://discuss.kotlinlang.org/u/milty)\
**Replies:** 0\
**Last updated:** [July 20, 2022, 5:18pm UTC](https://discuss.kotlinlang.org/t/open-overriden-properties-serialization/25254 "2022-07-20T17:18:51Z")

</div>

While this guide covers a lot of useful examples for polymorphic classes serialization, I couldn’t find any information about one particular (and to my mind, very useful) case. Serialization of open classes and their ch…

---

## [A benchmark to show you how fast my ORM framework is](https://discuss.kotlinlang.org/t/a-benchmark-to-show-you-how-fast-my-orm-framework-is/25242)

<div class="topic-metadata">

**Author:** [@babyfish-ct](https://discuss.kotlinlang.org/u/babyfish-ct)\
**Replies:** 1\
**Last updated:** [July 19, 2022, 3:02pm UTC](https://discuss.kotlinlang.org/t/a-benchmark-to-show-you-how-fast-my-orm-framework-is/25242 "2022-07-19T15:02:41Z")

</div>

At present, the only one problem of this ORM framework is that the Java API is not elegant enough. The next version will provide kotlin-specific API, please wait for a while. Jimmer has achieved the following two goal…

---

## [List of Kotlin Tool/Library Wishes?](https://discuss.kotlinlang.org/t/list-of-kotlin-tool-library-wishes/24879)

<div class="topic-metadata">

**Author:** [@danialgoodwin](https://discuss.kotlinlang.org/u/danialgoodwin)\
**Replies:** 3\
**Last updated:** [May 25, 2022, 6:25am UTC](https://discuss.kotlinlang.org/t/list-of-kotlin-tool-library-wishes/24879 "2022-05-25T06:25:19Z")

</div>

Hi, does anybody know of a good resource for a list of tools or libraries that people want in Kotlin? I’d like to practice Kotlin more, and creating things to help further the Kotlin reach is a great motivation for me. A…

---

## [Adding Char.repeat to stdlib](https://discuss.kotlinlang.org/t/adding-char-repeat-to-stdlib/24864)

<div class="topic-metadata">

**Author:** [@ivan-moto](https://discuss.kotlinlang.org/u/ivan-moto)\
**Replies:** 4\
**Last updated:** [May 23, 2022, 1:17am UTC](https://discuss.kotlinlang.org/t/adding-char-repeat-to-stdlib/24864 "2022-05-23T01:17:19Z")

</div>

We have CharSequence.repeat which produces a String. I would like Char.repeat which would also produce a String. Then you can do e.g. '\*'.repeat(5) and get a String. Can this be added?

---

## [\[kotlinx.serializatinon\] Proper Registration of Primitives and Nulls in Polymorphic Serialization](https://discuss.kotlinlang.org/t/kotlinx-serializatinon-proper-registration-of-primitives-and-nulls-in-polymorphic-serialization/24860)

<div class="topic-metadata">

**Author:** [@mjgroth](https://discuss.kotlinlang.org/u/mjgroth)\
**Replies:** 0\
**Last updated:** [May 21, 2022, 7:24pm UTC](https://discuss.kotlinlang.org/t/kotlinx-serializatinon-proper-registration-of-primitives-and-nulls-in-polymorphic-serialization/24860 "2022-05-21T19:24:23Z")

</div>

I just wanted to notify these forums that I posted a question on Stack Overflow here about including nulls and primitives and polymorphic serialization

---

## [Ktor - MultiPartFormDataContent filename encoding](https://discuss.kotlinlang.org/t/ktor-multipartformdatacontent-filename-encoding/24814)

<div class="topic-metadata">

**Author:** [@ak\_sc](https://discuss.kotlinlang.org/u/ak_sc)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 12:28pm UTC](https://discuss.kotlinlang.org/t/ktor-multipartformdatacontent-filename-encoding/24814 "2022-05-13T12:28:18Z")

</div>

hi there. I found an example of file uploading with ktor as a multiPart request. Ktor - Upload file What if the file name contains special characters? like Übung 001.pdf val client = HttpClient(CIO) val response: H…

[Previous page](https://discuss.kotlinlang.org/c/libraries/11.md?page=1)

[Next page](https://discuss.kotlinlang.org/c/libraries/11.md?page=3)
