Bug 62889

Summary: JSON Path Tester not formatting JSON-content
Product: JMeter Reporter: arnold.strasser
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: minor Keywords: FixedInTrunk
Priority: P2    
Version: 5.0   
Target Milestone: JMETER_5.1   
Hardware: PC   
OS: All   
Attachments: Response not formatted
Add JSONArray and JSONValue detection for pretty printing

Description arnold.strasser 2018-11-07 05:36:04 UTC
Created attachment 36248 [details]
Response not formatted

Hi! 

It seems that the JSON Path Tester in the "View Results Tree"-element has a minor bug.

If the JSON-response starts with an "[", the response content doesnt get formatted as you can see in the attached screenshots. Any other JSON-response is correctly formatted. 

Best regards,
Arnold
Comment 1 Felix Schumacher 2018-11-07 06:08:33 UTC
You are right. We missed to check for JSONArray in RenderAsJson (around line 71,where we checked for JSONObject) and handle it.

If no one beats me to it, I will add that this evening.
Comment 2 Felix Schumacher 2018-11-07 11:18:42 UTC
Created attachment 36249 [details]
Add JSONArray and JSONValue detection for pretty printing
Comment 3 Felix Schumacher 2018-11-07 17:20:46 UTC
Thans for the report. The fix will be included in 5.1

Date: Wed Nov  7 17:19:24 2018
New Revision: 1846060

URL: http://svn.apache.org/viewvc?rev=1846060&view=rev
Log:
Format JSON Arrays when displayed with JSON Path Tester

Bugzilla Id: 62889

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsJSON.java
    jmeter/trunk/test/src/org/apache/jmeter/visualizers/TestRenderAsJson.java
    jmeter/trunk/xdocs/changes.xml