Had to go back to *LaissezFaireSubTypeValidator.instance* as I'm getting an exception when using the default generated by *BasicPolymorphicTypeValidator.builder().build()*
On Friday, September 27, 2019 at 11:32:31 AM UTC+1, Guido Medina wrote: > > Though this form look more standard? > > > public static final ObjectMapper USER_PREFS_MAPPER = > configureDefaultObjectMapper(JsonMapper.builder(SmileFactory.builder() > .disable(ENCODE_BINARY_AS_7BIT) > .enable(CHECK_SHARED_STRING_VALUES) > .build()) > > .activateDefaultTyping(BasicPolymorphicTypeValidator.builder().build(), > ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, > JsonTypeInfo.As.WRAPPER_ARRAY).build() > ); > > > > On Friday, September 27, 2019 at 11:25:36 AM UTC+1, Guido Medina wrote: >> >> So, will then the following provide me the same functionality? >> >> public static final ObjectMapper USER_PREFS_MAPPER = >> configureDefaultObjectMapper(JsonMapper.builder( >> SmileFactory.builder() >> .disable(ENCODE_BINARY_AS_7BIT) >> .enable(CHECK_SHARED_STRING_VALUES) >> .build()) >> .activateDefaultTyping(LaissezFaireSubTypeValidator.instance, >> ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, >> JsonTypeInfo.As.WRAPPER_ARRAY).build() >> ); >> >> >> >> On Friday, September 27, 2019 at 10:41:53 AM UTC+1, Marc Dzaebel wrote: >>> >>> Guido, >>> >>> I already asked such questions in the "polymorphic serialization" issue >>> but I agree, that we'd need an adapted documentation on this topic. You >>> might look in test samples with >>> JsonMapper.builder().activateDefaultTyping(...). >>> >>> Marc >>> >> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/ab3aa977-0e57-4969-93fe-c074ef3124d5%40googlegroups.com.
