From d6267a394b7c1edfa55bbd7dfe065ad16a362fa5 Mon Sep 17 00:00:00 2001 From: pkupczyk <pkupczyk> Date: Wed, 30 May 2012 08:29:05 +0000 Subject: [PATCH] SP-70 / BIS-35: JSON-RPC - detect subtypes automatically (first implementation) SP-67 / BIS-35: Add Jackson annotations to all classes used in JSON-RPC interfaces (change @JsonTypeName to @JsonObject to make the annotation visible in JavaDoc) SVN: 25393 --- .../openbis/remoteapitest/api/v1/TestJsonServiceFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/TestJsonServiceFactory.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/TestJsonServiceFactory.java index 5ce040e5e23..9652f0b1b54 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/TestJsonServiceFactory.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/TestJsonServiceFactory.java @@ -25,6 +25,7 @@ import org.codehaus.jackson.map.ObjectMapper; import com.googlecode.jsonrpc4j.JsonRpcHttpClient; import com.googlecode.jsonrpc4j.ProxyUtil; +import ch.systemsx.cisd.common.api.server.json.JsonReflectionsSubTypeResolver; import ch.systemsx.cisd.common.api.server.json.JsonTypeAndClassAnnotationIntrospector; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationChangingService; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; @@ -48,6 +49,7 @@ public class TestJsonServiceFactory { ObjectMapper mapper = new ObjectMapper(); mapper.setAnnotationIntrospector(new JsonTypeAndClassAnnotationIntrospector(null)); + mapper.setSubtypeResolver(JsonReflectionsSubTypeResolver.getDefaultInstance()); JsonRpcHttpClient client = new JsonRpcHttpClient(mapper, new URL(GENERAL_INFO_SERVICE_URL), new HashMap<String, String>()); -- GitLab