Skip to content
Snippets Groups Projects
Commit d6267a39 authored by pkupczyk's avatar pkupczyk
Browse files

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
parent 0e4df30c
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ import org.codehaus.jackson.map.ObjectMapper; ...@@ -25,6 +25,7 @@ import org.codehaus.jackson.map.ObjectMapper;
import com.googlecode.jsonrpc4j.JsonRpcHttpClient; import com.googlecode.jsonrpc4j.JsonRpcHttpClient;
import com.googlecode.jsonrpc4j.ProxyUtil; 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.common.api.server.json.JsonTypeAndClassAnnotationIntrospector;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationChangingService; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationChangingService;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService;
...@@ -48,6 +49,7 @@ public class TestJsonServiceFactory ...@@ -48,6 +49,7 @@ public class TestJsonServiceFactory
{ {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
mapper.setAnnotationIntrospector(new JsonTypeAndClassAnnotationIntrospector(null)); mapper.setAnnotationIntrospector(new JsonTypeAndClassAnnotationIntrospector(null));
mapper.setSubtypeResolver(JsonReflectionsSubTypeResolver.getDefaultInstance());
JsonRpcHttpClient client = JsonRpcHttpClient client =
new JsonRpcHttpClient(mapper, new URL(GENERAL_INFO_SERVICE_URL), new JsonRpcHttpClient(mapper, new URL(GENERAL_INFO_SERVICE_URL),
new HashMap<String, String>()); new HashMap<String, String>());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment