fix #9722 serialization of response by jackson
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 22 Jul 2021 15:07:14 +0000 (17:07 +0200)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 22 Jul 2021 15:07:14 +0000 (17:07 +0200)
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/MediaController.java

index add8c8d53f0e3e588d476f97c16e649ae9ecf434..65c490625576253c95b68e72fe6f70296e796eaa 100644 (file)
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;\r
 import org.springframework.web.bind.annotation.RequestMethod;\r
 import org.springframework.web.bind.annotation.RequestParam;\r
+import org.springframework.web.bind.annotation.ResponseBody;\r
 \r
 import eu.etaxonomy.cdm.api.service.IMediaService;\r
 import eu.etaxonomy.cdm.api.service.media.MediaInfoFactory;\r
@@ -67,6 +68,7 @@ public class MediaController extends AbstractIdentifiableController<Media, IMedi
 \r
 \r
     @RequestMapping(value = {"metadata"}, method = RequestMethod.GET)\r
+    @ResponseBody // = is REST service method with json response\r
     public Map<String, String> doGetMediaMetaData(\r
             @PathVariable("uuid") UUID uuid,\r
             @RequestParam(value = "applyFilterPreset", defaultValue = "true") Boolean applyFilterPreset,\r
@@ -85,8 +87,7 @@ public class MediaController extends AbstractIdentifiableController<Media, IMedi
             URI uri = null;\r
             try {\r
                 if(applyFilterPreset) {\r
-                        result = service.readResourceMetadataFiltered(mediaRepresentation);\r
-\r
+                   result = service.readResourceMetadataFiltered(mediaRepresentation);\r
                 } else {\r
                     uri = mediaRepresentation.getParts().get(0).getUri();\r
                     CdmImageInfo cdmImageInfo = mediaInfoFactory.cdmImageInfoWithMetaData(uri);\r