FasterXML / FasterXML/jackson-databind
Support `@JsonAnySetter` on setter method (single `Map` parameter)
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.5k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 28
Description
### Discussed in https://github.com/FasterXML/jackson-databind/discussions/4888
Originally posted by **chrylis** January 7, 2025
Currently, `@JsonAnySetter` can be used on a physical field of type `Map`, but unlike `@JsonProperty`, it will be silently dropped if used on a method of arity other than two (`POJOPropertiesCollector#_addMethods`). I would like to be able to use `@JsonAnySetter` on a method representing a virtual property, like this:
```
@Slf4j
class WebhookDto {
@JsonAnySetter
void setUnmappedProperties(Map unmapped) {
log.warn("unmapped properties on webhook: {}", unmapped)
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.