K
K
Kirill Ozeretskovsky2020-07-16 19:46:58
Scala
Kirill Ozeretskovsky, 2020-07-16 19:46:58

Is there a JSON library for Kotlin or Scala that will work with data/case classes without annotations?

We need a library for working with JSON, which will not use class annotations and at the same time will be able to turn objects that come from the browser into the corresponding classes. I ask about both Scala and Kotlin, because these two JVM languages ​​allow you to share code between the client and the server. The essence of the idea is to store the models in a shared space and at the same time transfer them between the client and the server. Accordingly, any JVM annotations are not suitable, since this code will not compile in a "browser" environment.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Zagaevsky, 2020-07-16
@zagayevskiy

Look aside https://github.com/Kotlin/kotlinx.serialization

A
asxat, 2020-07-22
@asxat

Via automatic derivation can be done at https://circe.github.io/circe/

A
alekseyHunter, 2020-07-22
@alekseyHunter

Works for me without GSON+Retrofit2 annotations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question