https://kotlinlang.org logo
Title
f

Filip Husnjak

04/17/2018, 11:45 AM
Hello again I have run into a small issue. I want to serialize my model using GSON but i get stuck with an StackOverflow so to solve this i wanted to try using expose annotations which do not work “This Annotation is not applicable to target ’member property with delegate”
@Expose(true)
     var name by Table.name
Meaning that i cannot specify what to serialize and what to not serialize. The way i have solved this now is to use a Data Class along side my model class, which is a pain because then i would have to have tree objects for one table. There must be a better way!
m

Marek Defeciński

04/17/2018, 11:50 AM
maybe @delegate:Expose ?
f

Filip Husnjak

04/17/2018, 11:55 AM
This works but did not solve my issue. I wanted to print my serialized class variable but instead it printed
{
  "name$delegate": {}
}