diff --git a/HISTORY.md b/HISTORY.md index 5a5b498..b3a4836 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,12 @@ https://github.com/josdejong/jsoneditor +## not yet released, version 5.32.5 + +- Fixed a bug in the JMESPath query wizard which didn't correctly handle + selecting multiple fields. + + ## 2019-04-10, version 5.32.4 - Fixed #682 and #687: JSONEditor not being able to handle JSON schema diff --git a/src/js/showTransformModal.js b/src/js/showTransformModal.js index 50d749b..70f1715 100644 --- a/src/js/showTransformModal.js +++ b/src/js/showTransformModal.js @@ -233,14 +233,14 @@ function showTransformModal (node, container) { } if (values.length === 1) { - query.value += '.' + selectedValue; + query.value += '.' + values[0]; } else if (values.length > 1) { query.value += '.{' + values.map(function (value) { var parts = value.split('.'); var last = parts[parts.length - 1]; - return last + ': ' + selectedValue; + return last + ': ' + value; }).join(', ') + '}'; }