question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transient not working

See original GitHub issue

The kdoc of Transient says:

Marks the JVM backing field of the annotated property as transient, meaning that it is not part of the default serialized form of the object.

However this is not the case with the serialization plugin as it serializes transient properties.

import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json

@Serializable
data class Data(val a: Int) {

  @Transient
  val b = "Hello"
}

fun main() {
  val serialized = Json.stringify(Data.serializer(), Data(1))
  val expected = """{"a":1}"""
  check(serialized == expected)
}
  • Kotlin version: [e.g. 1.3.31]
  • Library version: [e.g. 0.11.1] ]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
natanfudgecommented, Sep 6, 2019

If you decide not to recognize it, I suggest to show a compile-time warning when using the wrong Transient on a Serializable class. This mistake is very easy to make…

0reactions
qwwdfsadcommented, Jul 13, 2020

IDE warning arrives in the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - @Transient not working in hibernate - Stack Overflow
Check the @Transient annotation fully qualified name. It can be from either, org.springframework.
Read more >
Tab to Transient not working correctly - Gearspace.com
I'm having a problem with Tab to Transient feature in Pro tools 8 M-Powered. Everytime to have Tab to transient selected I click...
Read more >
Tab To Transient Not Working - Cakewalk by BandLab
For some reason, the tab to transient completely stop working on all my projects.
Read more >
Ignoring Fields With the JPA @Transient Annotation - Baeldung
Learn how to ignore fields using the JPA @Transient annotation in Java. ... However, the @Transient annotation does not affect Java object ...
Read more >
Tab to Transient Not Catching Transients? : r/protools - Reddit
for the track you're working on, turn elastic audio on · select the clip (or multiple clips) you want to edit · Clip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found