quarkus-rest-jackson
doesn't support @JsonManagedReference/@JsonBackReference
#45753
Labels
quarkus-rest-jackson
doesn't support @JsonManagedReference/@JsonBackReference
#45753
Describe the bug
Hello,
I'm facing a strange behavior with Quarkus 3.17.6 and
quarkus-rest-jackson
extension. A REST service CRUDs a couple of JPA entities. These entities maintain a bi-directional one-to-many relationship. In order to avoid infinite recursion, the Jackson@JsonManagedReference/@JsonBackReference
annotation are used.Trying to serialize payloads containing these entities, the following exception is raised:
Expected behavior
I expect that
quarkus-rest-jackson
be able to use@JsonManagedReference/@JsonBackReference
and to successfuly serialize the entities.In order to make sure that this should work, I implemented exactly the same test case using Jakarta EE 10 and it works as expected.
Actual behavior
The Quarkus implementation doesn't work and raises the mentioned exception, as opposed to the Jakarta EE implemntation, whichworks as expected.
How to Reproduce?
Reproducer: https://github.com/nicolasduminil/orms.git
The repository has two projects: quarkus-orm which reproduces the issue and jakarta-orm which works as expected.
The README.md file in the repository contains instructions of how to reproduce.
Output of
uname -a
orver
Linux nicolas-XPS-15-9570 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "21.0.3" 2024-04-16 LTS Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-152) Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-152, mixed mode, sharing)
Quarkus version or git rev
3.17.6
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /opt/apache-maven-3.9.5 Java version: 21.0.3, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-21-oracle-x64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.8.0-51-generic", arch: "amd64", family: "unix"
Additional information
N/A
The text was updated successfully, but these errors were encountered: