Bug 60295

Summary: JSON Extractor doesn't index array elements when only one element is found
Product: JMeter Reporter: Felix Schumacher <felix.schumacher>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: p.mouawad
Priority: P2    
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Attachments: Extract json elements into varname_1 when matchnumber is -1

Description Felix Schumacher 2016-10-21 18:26:43 UTC
Created attachment 34399 [details]
Extract json elements into varname_1 when matchnumber is -1

When matchnumber is set to "-1" and only one element is extracted by the JSON Extractor, it currently forgets to append the varname with "_1".

In comparison the Regex Extractor appends the varname with "_1" in such a case. Therefore the JSON Extractor should behave similarly.
Comment 1 Philippe Mouawad 2016-10-21 18:31:51 UTC
+1 for integration 
thanks Felix
Comment 2 Felix Schumacher 2016-10-21 18:40:46 UTC
Date: Fri Oct 21 18:39:22 2016
New Revision: 1766100

URL: http://svn.apache.org/viewvc?rev=1766100&view=rev
Log:
JSON Extractor doesn't index array elements when only one element is found.
Based on patch by Roberto Braga (roberto.braga at sociale.it).

Bugzilla Id: 60295

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/json/jsonpath/JSONPostProcessor.java
    jmeter/trunk/test/src/org/apache/jmeter/extractor/TestJSONPostProcessor.java
    jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
    jmeter/trunk/xdocs/changes.xml