Bug 60295 - JSON Extractor doesn't index array elements when only one element is found
Summary: JSON Extractor doesn't index array elements when only one element is found
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.0
Hardware: All Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-21 18:26 UTC by Felix Schumacher
Modified: 2016-10-21 18:40 UTC (History)
1 user (show)



Attachments
Extract json elements into varname_1 when matchnumber is -1 (6.68 KB, patch)
2016-10-21 18:26 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 3 The ASF infrastructure team 2022-09-24 20:38:06 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4155