I have a Spring Boot (2.1.1) app that is modeling ActivityStreams 
<https://www.w3.org/TR/activitystreams-vocabulary> objects and for the most 
part Jackson's (2.9.7) Polymorphic Deserialization works well.


There are 'objects' in the JSON which are references (links) and not JSON 
objects with type information. For instance


 "actor":"https://some.actors.href/ 


rather than


"actor":{
   "type":"Actor",
   "name":"SomeActor"
 }


I've written custom deserializers and and placed them on the fields to deal 
with this


@JsonDeserialize (using = ActorOrLinkDeserializer.class)
private Actor actor;


However my ActorOrLinkDeserializer is instantiated but never called and 
Jackson complains with


 Missing type id when trying to resolve subtype of [simple type, class 
org.w3.activity.streams.Actor]: missing type id property 'type' (for POJO 
property 'actor') 

 

which is from the polymorphic deserializer.


It appears that the polymorphic deserialization code takes precedence over 
my local @JsonDeserialize annotation and I need a way to force my code to 
have precedence when a @JsonDeserializer annotated field is encounted.


I've tried using my own ObjectMapper with a SimpleModule and get the same 
result.


I'd appreciate pointers and suggestions.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to