You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use @JsonCreator to test the input arguments in the constructor. And I want to support alternate API options with or without "@id" (in some places there is recursion, and somewhere there is no).
If the way for this test to be performed without errors?
com.fasterxml.jackson.databind.exc.MismatchedInputException: No Object Id found for an instance of com.example.JsonIdentityInfoWithJsonCreatorTest$Foo, to assign to property '@id'
At this point Object Id must be present, if one is expected.
Perhaps it would be possible to have a DeserializationFeature that allows missing type id during deserialization: if so, such values would not be referencable, but would not fail.
Alternatively... maybe a better way would be to add one more property for @JsonIdentityInfo, something like requireId or just required, which would apply to that specific type.
I think I like this approach more.
I will change the title to reflect this as RFE, assuming that ability to optionally exclude Object Ids is what you would like to see, regardless of mechanism.
cowtowncoder
changed the title
@JsonIdentityInfo and @JsonCreator
Allow optional Object Id for @JsonIdentityInfoJul 21, 2017
Related to the #1388 and #1261
I need to use
@JsonCreator
to test the input arguments in the constructor. And I want to support alternate API options with or without"@id"
(in some places there is recursion, and somewhere there is no).If the way for this test to be performed without errors?
com.fasterxml.jackson.databind.exc.MismatchedInputException: No Object Id found for an instance of com.example.JsonIdentityInfoWithJsonCreatorTest$Foo, to assign to property '@id'
Tested on
2.8.3
and2.9.0.pr4
The text was updated successfully, but these errors were encountered: