jackson-annotations icon indicating copy to clipboard operation
jackson-annotations copied to clipboard

Add support for prefix and suffix on @JsonAnySetter annotation

Open alxxyz opened this issue 2 years ago • 3 comments

In our POJO we have 2 Map fields and both have keys prefixes. So it will very help if @JsonAnySetter annotation will support some prefixes and suffixes.

class Request {

    @JsonAnySetter(prefix="loc_")
    private Map<String, String> location;
    
    @JsonAnySetter(prefix="u_")
    private Map<String, String> user;
}

alxxyz avatar Apr 08 '22 09:04 alxxyz

Contributions welcome!

cowtowncoder avatar Apr 08 '22 16:04 cowtowncoder

@cowtowncoder can you please help to understand the flow to add this functionality?

  1. to create PR to change the @JsonAnySetter annotation
  2. to create PR in https://github.com/FasterXML/jackson-databind to test new functionality?

alxxyz avatar Aug 02 '22 08:08 alxxyz

@alxxyz Yes, jackson-databind has the annotation introspectors. Testing would probably require local snapshot builds.

cowtowncoder avatar Aug 02 '22 23:08 cowtowncoder