Not possible to import realm with newest Java admin-client against Keycloak 24
closes #32035 Signed-off-by: mposolda <mposolda@gmail.com>
This commit is contained in:
parent
6a91b3be6c
commit
e7d9a717c9
1 changed files with 14 additions and 0 deletions
|
@ -1,6 +1,20 @@
|
||||||
package org.keycloak.admin.client;
|
package org.keycloak.admin.client;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider;
|
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider;
|
||||||
|
|
||||||
public class JacksonProvider extends ResteasyJackson2Provider {
|
public class JacksonProvider extends ResteasyJackson2Provider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectMapper locateMapper(Class<?> type, MediaType mediaType) {
|
||||||
|
ObjectMapper objectMapper = super.locateMapper(type, mediaType);
|
||||||
|
|
||||||
|
// Same like JSONSerialization class. Makes it possible to use admin-client against older versions of Keycloak server where the properties on representations might be different
|
||||||
|
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
|
|
||||||
|
return objectMapper;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue