Closed kartikeytewari-ul closed 1 month ago
findReferenceType
in JacksonAnnotationIntrospector
checks if a fields has the annotation of type JsonManagedReference or JsonBackReference. But when that check happens, these class gets resolved to classes inside SDK like selogger.com.fasterxml.jackson.annotation.JsonManagedReference
.selogger.com.fasterxml.jackson
, then issue does not comes since the pojo field are indeed annotated with the annotations.com.fasterxml.jackson
them the match fails.findReferenceType
can be modified to check for both classes inside selogger and in main jackson package._findAnnotation
is the downstream call from all methods including findReferenceType
to check presence of annotation. This can be modified to check annotations inside and outside of selogger package.This is resolved in PR #110
Describe the bug
The SDK uses jackson for serialisation and deserialisation. The sdk's jackson enforces the user to use annotation from unlogged sdk in there project like
selogger.com.fasterxml.jackson.annotation
instead of using the annotation from main jackson package likecom.fasterxml.jackson.annotation
.This forces the user to modify the code base in few places for the SDK to work properly.
Reproduction steps
Project: unlogged-spring-maven-demo Class: SessionExceptions Pojo: Department and Employee
@JsonManagedReference
and@JsonBackReference
fromselogger.com.fasterxml.jackson
. In mock created forfindAll
, hover over the output value. It will be populated correctly with data.com.fasterxml.jackson
. Mock value will now throw an infinite recursion stack trace, since the SDK did not use the annotation values.Expected behaviour
The SDK should use the annotation of main jackson package.