question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow 'JsonAnySetter' to flow through JsonCreator.

See original GitHub issue

I could speed up some code if I could write:

@JsonCreator
public MyClass(@JsonProperty("a") String a, @JsonAnySetter Map<String, Object> leftovers) {}

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:39
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
cowtowncodercommented, Feb 5, 2019

@huhlig It would be nice to get it there, but I can not predict whether it will or not. I do think it would be great to get it to work but there are so many things to work on…

I will keep this in mind as one of “more/most wanted” issues.

0reactions
davide-imbriacocommented, Jan 28, 2019

Hi, I would also really like this (allows for immutable beans, and validation of data in constructor method).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use @JacksonInject with @JsonCreator on a top level map
I would like to deserialize my objects this way as it also allows to create immutable objects, instead of using @JsonAnySetter which doesn't ......
Read more >
Guide to Jackson Annotations | Novixys Software Dev Blog
The solution is to use @JsonAnySetter on a method which accepts a key and a value to set the property. See below.
Read more >
Jackson Annotations - Jenkov.com
The Jackson annotation @JsonAnySetter instructs Jackson to call the same setter method for all unrecognized fields in the JSON object.
Read more >
Jackson JSON - Using @JsonAnySetter to deserialize ...
@JsonAnySetter annotation can be used to define "any setter" mutator. It is used on a non-static two-argument method; first argument is name ...
Read more >
Flexible immutability with Jackson and Lombok - Luminis
Data model allows for flexible addition of properties at runtime ... I'm using @JsonCreator on the constructor to indicate that this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found