Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to Evaluate filters with select #2

Open
ahmad-masalha opened this issue Jan 25, 2022 · 0 comments
Open

Failing to Evaluate filters with select #2

ahmad-masalha opened this issue Jan 25, 2022 · 0 comments

Comments

@ahmad-masalha
Copy link

ahmad-masalha commented Jan 25, 2022

var json = "[{\"id\":\"123\",\"name\":\"mytest\",\"email\":\"[email protected]\"}]"
var query = ".[] | select(.name==\"mytest\") | .id == \"123\"";
var result = query.EvalToToken(receivedJSON);

Exception:

EvalToToken(receivedJSON)' threw an exception of type 'Sprache.ParseException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233088
HelpLink: null
InnerException: null
Message: "Parsing failure: unexpected '['; expected } (Line 1, Column 20); recently consumed: : .headers"
Position: {Line 1, Column 20}
Source: "Sprache"
StackTrace: " at Sprache.ParserExtensions.Parse[T](Parser`1 parser, String input)\r\n at Coeus.JQ.<>c__DisplayClass12_0.b__0(String _)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Coeus.JQ.Eval(String jq, JToken token)\r\n at Coeus.JQ.EvalToToken(String jq, JToken token)"
TargetSite: {T Parse[T](Sprache.Parser`1[T], System.String)}

How can I overcome this bug?

@ahmad-masalha ahmad-masalha changed the title Failing to Evaluate filters which include \" as char Failing to Evaluate filters with select Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant