google / google/json_serializable.dart
Question: Will this packages support `extension types` like `kotlinx.serialization`?
Open
Type: enhancement
- Dominant language
- Dart
- Stars
- 1.6k
- Forks
- 461
- Avg merge
- 45m
- Merged PRs (30d)
- 1
Description
Kotlin's JSON serialization library(`kotlinx.serialization`) supports the value class in the following way:
Code:
```kotlin
@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:
```JSON
{"color": 0, "name": "black"}
```
I'm wondering if this package will support Json serialization in a similar way to Kotlin.
Contributor guide
Assessment
This issue has not been assessed yet.