brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Improvements to brooklyn-server/r...
Date Thu, 28 Jan 2016 10:43:00 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1177#discussion_r51106038
  
    --- Diff: brooklyn-server/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java
---
    @@ -137,25 +136,21 @@ public static ObjectMapper newPrivateObjectMapper(ManagementContext
mgmt) {
                 throw new IllegalStateException("No management context available for creating
ObjectMapper");
             }
     
    -        SerializationConfig defaultConfig = new ObjectMapper().getSerializationConfig();
    -        SerializationConfig sc = new SerializationConfig(
    -            defaultConfig.getClassIntrospector() /* ObjectMapper.DEFAULT_INTROSPECTOR
*/,
    -            defaultConfig.getAnnotationIntrospector() /* ObjectMapper.DEFAULT_ANNOTATION_INTROSPECTOR
*/,
    -            new PossiblyStrictPreferringFieldsVisibilityChecker(),
    -            null, null, TypeFactory.defaultInstance(), null);
    -
             ConfigurableSerializerProvider sp = new ConfigurableSerializerProvider();
             sp.setUnknownTypeSerializer(new ErrorAndToStringUnknownTypeSerializer());
     
    -        ObjectMapper mapper = new ObjectMapper(null, sp, null, sc, null);
    +        ObjectMapper mapper = new ObjectMapper();
    +        mapper.setSerializerProvider(sp);
    +        mapper.setVisibility(new PossiblyStrictPreferringFieldsVisibilityChecker());
    +
             SimpleModule mapperModule = new SimpleModule("Brooklyn", new Version(0, 0, 0,
"ignored"));
     
             new BidiSerialization.ManagementContextSerialization(mgmt).install(mapperModule);
             new BidiSerialization.EntitySerialization(mgmt).install(mapperModule);
             new BidiSerialization.LocationSerialization(mgmt).install(mapperModule);
    -        mapperModule.addSerializer(new MultimapSerializer());
    --- End diff --
    
    we do need the `MultiMapSerializer` -- else multimaps (map of maps) are horrible to work
with -- maybe it's there by default now?  is there a test for this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message