Hi JiWon,
There’s no need to use the JSONObject class or anything similar to convert the map data to JSON. In the Snap API, the data structures associated with input and output documents aren’t JSON; they are just Java objects like Map, List, and primitives (String, Integer, etc). These data structures can be easily mapped to JSON but you don’t need to use any sort of JSON-specific API to read or write them.
Try something like this instead:
Document outputDoc = documentUtility.newDocumentFor(document, inputDataFromMapper);
outputViews.write(outputDoc);