Computed property not serialize
See original GitHub issueA data class with computed property:
data class Bean(val name: String) {
val computed: String
get() = "--$name"
}
Use `kotlinx-serialization-runtime-0.20.0’:
val result = Json(Stable).stringify(Bean.serializer(), Bean(name = "rj"))
the result is {"name":"rj"}
but I want it to be {"name":"rj","computed":"--rj"}
. How?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - Why are properties without a setter not serialized
I have a serializable class and one of the properties in my class generates a Guid in the getter. The property implements no...
Read more >4 ways to make a property deserializable but not serializable ...
Approach 1: Use attributes JsonProperty together with JsonIgnore · We still use [JsonIgnore] attribute, adding it to the property which we do not...
Read more >Serialize computed property Carbon instance - Laracasts
Hi, my model offers a computed property called "departureTime"; if a departure time is available, it will be returned as a Carbon instance....
Read more >Should I expose a "computed" value as a property or a method?
not more than, let's say, ten times slower to compute than fetching from a field. ... Knerd makes a good point: properties can...
Read more >Ember Models - Computed Property - General
Seems that computed properties are being phased out but not sure if there's ... If it's like a “front-end only” field or something...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I need this feature also.
Example use case: my image urls are computed and not stored in the database.
This is still open?