shakilsiraj / json-object-mapper

A TypeScript library to serialize and deserialize object graph from/to JSON in a fast and non-recursive way
MIT License
58 stars 18 forks source link

Getter property serialization #49

Open jonghshin opened 4 years ago

jonghshin commented 4 years ago

It looks like it is not serializing getters. The code below does not serialize the getter property.

export class ProjectModule extends ProjectBase {
  @JsonProperty({ name: "t" })
  public get ProjectType(): ProjectType {
    return ProjectType.Module;
  }
}

It only works with the code like this.

export class ProjectModule extends ProjectBase {
  @JsonProperty({ name: "t" })
  public readonly ProjectType: ProjectType = ProjectType.Module;
}

Any plan to implement getters and setters de/serialization?