Bug 62889 - JSON Path Tester not formatting JSON-content
Summary: JSON Path Tester not formatting JSON-content
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.0
Hardware: PC All
: P2 minor (vote)
Target Milestone: JMETER_5.1
Assignee: JMeter issues mailing list
Keywords: FixedInTrunk
Depends on:
Reported: 2018-11-07 05:36 UTC by arnold.strasser
Modified: 2018-11-07 17:20 UTC (History)
0 users

Response not formatted (52.91 KB, image/png)
2018-11-07 05:36 UTC, arnold.strasser
Add JSONArray and JSONValue detection for pretty printing (2.43 KB, patch)
2018-11-07 11:18 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arnold.strasser 2018-11-07 05:36:04 UTC
Created attachment 36248 [details]
Response not formatted


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,
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
Format JSON Arrays when displayed with JSON Path Tester

Bugzilla Id: 62889

Comment 4 The ASF infrastructure team 2022-09-24 20:38:15 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4913