Support for @JsonIdentityReference and @JsonIdentityInfo
When a member of a Java class is annotated with @JsonIdentityReference, Jackson will serialize it as a reference to another object, instead of the full nested object. The reference is derived from the @JsonIdentifyInfo annotation on the referenced class.
Examples and Javadoc is found here and here
The current schema generator does not take that into account.
I would be good when the generator will recognize the @JsonIdentifyReference in the Jackson module and generate the type information of the id of the references object instead of the object itself.
In my project I made an implementation of this. I will prepare a PR for it, so you can form an opinion.
The idea of it being serialised one way the first time it is encountered vs. subsequent encounters is a bit daunting.
But if you use it alwaysAsId = true I guess it should be straightforward.
Looking forward to the PR.
Hi @JanLabrie,
I guess you didn't get around to providing that PR. I'll introduce the basic version myself now in #298.
I'd still appreciate it if you happened to have some feedback on my solution. 😉