json - prettyPrint jsonNode in Play -


via play ws api get() response object. contains json call

response.asjson() 

which works fine. want return json in prettyprinted version tried call

json.prettyprint(response.asjson()) 

however not work because prettyprint expects jsvalue, not jsonnode. so question how convert jsonnode jsobject?

i guessing using play java. instead of converting jsvalue, like:

jsonnode node = response.asjson(); objectmapper mapper = new objectmapper();  string pretty = mapper.writerwithdefaultprettyprinter().writevalueasstring(node); 

Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -