Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Will this packages support extension types like kotlinx.serialization? #1405

Open
jpoh281 opened this issue Mar 10, 2024 · 0 comments

Comments

@jpoh281
Copy link

jpoh281 commented Mar 10, 2024

Kotlin's JSON serialization library(kotlinx.serialization) supports the value class in the following way:

Code:

@Serializable
@JvmInline
value class Color(val rgb: Int)


@Serializable
data class NamedColor(val color: Color, val name: String)

fun main() {
  println(Json.encodeToString(NamedColor(Color(0), "black")))
}

Json:

{"color": 0, "name": "black"}

I'm wondering if this package will support Json serialization in a similar way to Kotlin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant