Forum Discussion
5 Replies
- ptaylorEmployee
That’s correct:
Map<String, Object> data = document.get(Map.class);
- robinFormer Employee
See also Snap Development Documentation
- robinFormer Employee
@JiWon I don’t fully understand. If the next Snap is your custom Snap, the output document of the Mapper can be consumed via input views as per the developer documentation. In terms of the expression language,
$
refers to the entire input document (which can be serialized/deserialized to/from JSON)- JiWonNew Contributor II
Hi Robin,
Thanks for your reply.
Yes, the Mapper connects to my custom snap in which I wanna get the data from the mapper. Can I use document.get(Map.class) to get the data from the Mapper?
- DharaSPNew Contributor
Were you able to successfully get the JSON output ?
I am facing similar issue: Developing a custom SNAP that makes HTTP request and gets JSON response in return. The response is array of objects. In order to right it to document , currently it only shows up if I convert the response to string in following manner:
Map<String, Object> data = new LinkedHashMap<>();
data.put(“Response”, response);
outputViews.write(documentUtility.newDocumentFor(document, data));But I’d like to instead preview the response in standard json format in outputview. Any idea how this can be achieved ? Any help would be appreciated . Thank you