You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you want to serialize a large class but only serialize 1 or 2 fields within it. It's tedious to have to @Transient dozens of fields in order to only serialize 2. It would be nice if there was a configuration option for @Serializable which only serializes fields that are explicitly tagged with an @Expose annotation (or something similar).
Gson offers this feature.
See new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create() and @Expose
Api could be something similar to
@Serializable(explicit = true)
and
@Expose for the fields we want to serialize or @Explicit.
The text was updated successfully, but these errors were encountered:
Sometimes you want to serialize a large class but only serialize 1 or 2 fields within it. It's tedious to have to
@Transient
dozens of fields in order to only serialize 2. It would be nice if there was a configuration option for@Serializable
which only serializes fields that are explicitly tagged with an@Expose
annotation (or something similar).Gson offers this feature.
See
new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()
and@Expose
Api could be something similar to
@Serializable(explicit = true)
and
@Expose
for the fields we want to serialize or@Explicit
.The text was updated successfully, but these errors were encountered: