Closed davidvc closed 12 months ago
It works for me
This combination of annotations does not work.
I'm quite sure this has been fixed in the meantime. Can you confirm that this does not work with Lombok 1.18.22?
I'm quite sure this has been fixed in the meantime. Can you confirm that this does not work with Lombok 1.18.22?
yep, I'm using this version
same here
I just checked again, and cannot reproduce. Your example works for me both in Eclipse and javac (via maven compile). Please double-check that you are actually using the latest version of lombok (also check the version installed in Eclipse, if you are using that IDE).
I am. But I circunvented the issue by renaming the field instead of using @JsonProperty
. I did not have time to go deeper and I wonder if this could be an Intellij IDEA problem. I experienced this while using Intellij to build. If I have time, I will try reproducing it later.
Yes, it could be an IntelliJ IDEA issue. @Jacksonized
is rather new and experimental, and given that the IntelliJ lombok plugin has its own builder processing, it is very likely that IntelliJ does not (or not correctly) consider this annotation.
Try building with maven/gradle/whatever you use and check whether the problem persists. (If it does, it's a lombok issue, if not, it's on IntelliJ.)
I think @janrieke has it right. Without feedback, this can be closed 2022-04-01.
Same problem for me (1.18.24). Also using Intellij. Will rename field, no time to go deeper.
Make sure that all the jackson annotations are imported from the com.fasterxml.jackson.annotation
package and NOT from org.codehaus.jackson.annotate
package. This is a very easy mistake to make.
@nucatus You save my ass
seems fixed then.
Describe the bug If you use the @JsonProperty annotation on a field to provide a property name that differs from the field name, it does not work. This is with Lombok 1.8.2
To Reproduce Here is a sample class and a unit test that fails:
Here is the error I get:
When I look at the generated code, the Builder does not have any Jackson annotations on it:
Expected behavior Attaching @JsonProperty to a field should be honored using @Jacksonized with
@Value
Version info (please complete the following information):