FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

Add support for prefix and suffix on @JsonAnySetter annotation #202

Open alxxyz opened 2 years ago

alxxyz commented 2 years ago

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;
}
cowtowncoder commented 2 years ago

Contributions welcome!

alxxyz commented 2 years ago

@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?
cowtowncoder commented 2 years ago

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