Skip to content
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

NPE with @JsonIdentityInfo at class level #3907

Closed
daniel-schel opened this issue Mar 7, 2021 · 0 comments · Fixed by #3908
Closed

NPE with @JsonIdentityInfo at class level #3907

daniel-schel opened this issue Mar 7, 2021 · 0 comments · Fixed by #3908

Comments

@daniel-schel
Copy link
Contributor

daniel-schel commented Mar 7, 2021

ModelResolver throws a NullPointerException when using the IntSequenceGenerator at class level as shown in the following example.

public class Pojo {
	public Set<SubPojo> sub = new HashSet<>();
}

@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class)
public class SubPojo {
	public Set<SubPojo> sources = new HashSet<>();
}

The reason for this is that because of IntSequenceGenerator a property id is generated in order to add it to the model of the class SubPojo, but modelByType at ModelConverterContextImpl does not contain an AnnotatedType for this class at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant