Skip to content

Tag: jackson

Java show/hide object fields depending on REST call

Is it possible to config the Item class that depending on the REST call to show and hide specific fields? For example I want to hide colorId (and show categoryId) from User class when calling XmlController and vice versa when calling JsonController. Item class JSON Controller XML Controller Answer I’ve …

Jackson JSON custom class instantiator for third-party class

I am using a third-party POJO class RetryOptions that can only be created using a builder. The builder can only be instantiated using a static method RetryOptions.newBuilder(), or by calling options.toBuilder() on an existing instance. I would like to create custom de/serializers for the third-party POJO (Ret…