-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JsonIgnore on fields in panache entity not working #10339
Comments
/cc @FroMage, @loicmathieu |
I'll take a stab at this since I'm pretty sure I know what's going on |
Honour @JsonIgnore on Panache entities
perfect, thanks! Any chance to get this fix included in the upcoming 1.6.0? |
I think it should be backported, WDYT @FroMage ? |
Same problem here. |
I have the same problem with quarkus 1.7.1-Final. |
Mine is a little bit different. My application throws error when trying to serialize PanacheEntity properties extended by all model classes I have. |
Still broken in quarkus 1.9.2.FINAL and 1.8.1.FINAL |
Can you open a new issue with a reproducer please? |
@geoand I was able to isolate it to user error. I had both Jackson and Json-B in the cp, how embarrassing. Seems to be working with just Jackson on the cp. |
That's an easy to mistake to make TBH :) |
For my project, the issue was caused by using both jackson and jsonb. After removing jsonb from the dependencies, @JsonIgnore was honored again. |
Describe the bug
Starting with quarkus version 1.3.1 (until 1.6.0.CR1), ignoring fields with Jackson's @JsonIgnore annotation on the fields of panache entities doesn't work anymore. You have to add an explicit getter and place the annotation there to have an effect. That kind of defeats the purpose of panache's "property" style.
Expected behavior
Panache entity fields annotated with @JsonIgnore should be ignored in JSON serialization/deserialization.
should produce:
Actual behavior
Panache entity fields annotated with @JsonIgnore are NOT ignored in JSON serialization/deserialization.
To Reproduce
I've created a reproducer including a test to show this behavior. Running
mvn test
using any quarkus version >= 1.3.1 will fail.Reproducer
The text was updated successfully, but these errors were encountered: