Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

parse($top=6&$filter=A eq 10) gives error {"$top":6,"error":"invalid $filter parameter"} #14

Open
KarthikeyanLoganathan opened this issue Feb 3, 2015 · 2 comments

Comments

@KarthikeyanLoganathan
Copy link

Hi, if a property name is single-character-long(like A, B ...), then we get an error that it is "invalid $filter parameters".

@KarthikeyanLoganathan
Copy link
Author

I tried changing rule unreserved from a:[a-zA-Z0-9-] to a:[a-zA-Z0-9-]* Then it works fine.

//
unreserved = a:[a-zA-Z0-9-_]* { return a.join(''); }
//</Code snippit>

Note that I tried changing in my private copy of the code. I didn't change any code on this git branch.
I tested the fix at http://pegjs.org/online for an expression $top=6&$filter=A eq 10. It gives output as given below.
{
"$top": 6,
"$filter": {
"type": "eq",
"left": {
"type": "property",
"name": "A"
},
"right": {
"type": "literal",
"value": 10
}
}
}

@rehia
Copy link

rehia commented Jul 6, 2016

should this issue be closed?
This seems fixed...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants