Skip to content

FEATURE:@JsonOnlyProperties / @JsonIncludeProperties needed #133

@sunphy

Description

@sunphy

Let's say you have 1 entity with cascade need to be serialized, when you only need serialize part of cascaded entity, you should do it as following:

class Organization{
    private int id;
    private String name;
    private String address;
    private String telehpone;
    private String website;
    ......
}
class Person{
    private int id;
    private String firstName;
    private String lastName;
    @JsonIgnoreProperties({"address","telephone","website"})
    private Organization organization;
}

but what if the ignored properties is too many and I only need the id and name properties to be serialized?A @JsonOnlyProperties or @JsonIncludeProperties is more convenient and very easy to use.
Think this scenario is most needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions