I have a 3d library that is included in a class i uses that i want to serialize to json with jackson.
I want to jackson the object A, but ignore the field in Class C without being able to change the source code on Class B and C , is this possible?
class A {
B b;
}
class B {
C c;
}
class C {
int field;
}
I believe you can achieve a solution by using custom serializers.
You can add custom serializers through the ObjectMapper. I have created a small unit test below that demonstrates how it can be achieved: