Skip to content

Commit

Permalink
Merge pull request #301 from JanssenProject/yuriyz_fixes
Browse files Browse the repository at this point in the history
fix: reverted changes in ServerUtil
  • Loading branch information
yuriyzz authored Nov 2, 2021
2 parents 5c8e582 + f3920c3 commit 8f88633
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/src/main/java/io/jans/as/server/util/ServerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
package io.jans.as.server.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
import io.jans.as.common.service.common.ApplicationFactory;
import io.jans.as.model.uma.persistence.UmaPermission;
import io.jans.as.server.uma.service.UmaScopeService;
Expand Down Expand Up @@ -126,7 +129,15 @@ public static CacheControl cacheControlWithNoStoreTransformAndPrivate() {
}

public static ObjectMapper createJsonMapper() {
return Util.createJsonMapper();
final AnnotationIntrospector jaxb = new JaxbAnnotationIntrospector();
final AnnotationIntrospector jackson = new JacksonAnnotationIntrospector();

final AnnotationIntrospector pair = AnnotationIntrospector.pair(jackson, jaxb);

final ObjectMapper mapper = new ObjectMapper();
mapper.getDeserializationConfig().with(pair);
mapper.getSerializationConfig().with(pair);
return mapper;
}

public static ObjectMapper jsonMapperWithWrapRoot() {
Expand Down

0 comments on commit 8f88633

Please sign in to comment.