From 915f539a4e48210a2d450d93e7c35aed51e58fd8 Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Sat, 9 Sep 2023 16:06:19 +0200 Subject: [PATCH] Fix parsing jsonpath slice --- packages/hurl/src/jsonpath/parser/parse.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/hurl/src/jsonpath/parser/parse.rs b/packages/hurl/src/jsonpath/parser/parse.rs index f5f0f022c..cff55f900 100644 --- a/packages/hurl/src/jsonpath/parser/parse.rs +++ b/packages/hurl/src/jsonpath/parser/parse.rs @@ -61,6 +61,7 @@ fn selector(reader: &mut Reader) -> ParseResult { } fn selector_array_index_or_array_indices(reader: &mut Reader) -> Result { + let initial_state = reader.state.clone(); try_left_bracket(reader)?; let mut indexes = vec![]; let i = match natural(reader) { @@ -93,7 +94,16 @@ fn selector_array_index_or_array_indices(reader: &mut Reader) -> Result