{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/372","labels_url":"https://api.github.com/repos/jayway/rest-assured/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/jayway/rest-assured/issues/372/comments","events_url":"https://api.github.com/repos/jayway/rest-assured/issues/372/events","html_url":"https://github.com/jayway/rest-assured/issues/372","id":96244524,"number":372,"title":"Json: prettyPrint() throws exception for HashMap","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/rest-assured/labels/bug","name":"bug","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/rest-assured/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/rest-assured/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-21T06:57:00Z","updated_at":"2015-07-21T06:57:02Z","closed_at":null,"body":"_From [ir.tim....@gmail.com](https://code.google.com/u/105189091508678878966/) on February 27, 2013 10:11:06_\n\nWhat steps will reproduce the problem? 1. I try to use prettyPrint() method for Json file that looks like this:\r\n\r\n{\r\n   \"data\": [\r\n      {\r\n         \"uid\": 10,\r\n         \"name\": \"abc\"\r\n      }\r\n   ]\r\n} What is the expected output? What do you see instead? java.lang.NullPointerException: Cannot invoke method isArray() on null object.\r\n\r\n[org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77),\r\norg.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45),\r\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42),\r\norg.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32),\r\norg.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42),\r\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108),\r\norg.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112),\r\ngroovy.json.JsonOutput.toJson(JsonOutput.groovy:115),\r\ncom.jayway.restassured.path.json.JsonPath.prettify(JsonPath.java:555),\r\ncom.jayway.restassured.path.json.JsonPath.prettyPrint(JsonPath.java:564), What version of the product are you using? On what operating system? Rest-Assured 1.7.2 Please provide any additional information below. I suppose the reason is that JsonPath for this is represented by HashMap ( json = {java.util.HashMap}   {data=[{uid=10, name=abc}]} ).\r\nSo in prettify() method JsonOutput.toJson(json) is called, then in this part of the code\r\n\r\n } else if (object instanceof Collection ||\r\n                object.class.isArray() ||\r\n\r\nobject.class returns null because it is HashMap ( http://groovy.codehaus.org/FAQ+-+Collections,+Lists,+etc.#FAQ-CollectionsListsetc-WhydoesmyMapsizeormyMapclassreturnnull - maybe explanation here?)\n\n_Original issue: http://code.google.com/p/rest-assured/issues/detail?id=218_"},"comment":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/comments/123192118","html_url":"https://github.com/jayway/rest-assured/issues/372#issuecomment-123192118","issue_url":"https://api.github.com/repos/jayway/rest-assured/issues/372","id":123192118,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T06:57:02Z","updated_at":"2015-07-21T06:57:02Z","body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on April 16, 2013 06:37:23_\n\nCould you please try and see if you get the same error in the 1.8.0 release?"}}