Skip to content

Commit

Permalink
use parser
Browse files Browse the repository at this point in the history
  • Loading branch information
cancan101 committed Feb 18, 2025
1 parent bd68316 commit 7910a28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataSource/Interpreter/JsonFileInterpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter;

use JmesPath\Parser as Parser;
use JmesPath\Env as JmesPath;
use JmesPath\SyntaxErrorException;
use Pimcore\Bundle\DataImporterBundle\PimcoreDataImporterBundle;
Expand Down Expand Up @@ -68,8 +69,7 @@ public function setSettings(array $settings): void
{
$path = $settings['path'];
try {
// Run the expression on an empty array to check validity
JmesPath::search($path, []);
(new Parser)->parse($path);
} catch (SyntaxErrorException $e) {
throw new InvalidConfigurationException("Invalid JMESPath expression: " . $e->getMessage());
}
Expand Down

0 comments on commit 7910a28

Please sign in to comment.