Skip to content

Fixed: fail on non-leading whitespace in field chains #1252

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

Merged
merged 1 commit into from
Feb 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public IEnumerable<Token> EnumerateTokens()
}
else
{
if (_textBuffer.Length == 0 && ch == ' ' && !_isInQuotedSection)
if (ch == ' ' && !_isInQuotedSection)
{
throw new QueryParseException("Unexpected whitespace.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ public void Reader_Is_Enabled(JsonApiQueryStringParameters parametersDisabled, b
[InlineData("filter[posts]", "equals(author,'some')", "Attribute 'author' does not exist on resource type 'blogPosts'.")]
[InlineData("filter[posts]", "lessThan(author,null)", "Attribute 'author' does not exist on resource type 'blogPosts'.")]
[InlineData("filter", " ", "Unexpected whitespace.")]
[InlineData("filter", "contains(owner.displayName ,)", "Unexpected whitespace.")]
[InlineData("filter", "contains(owner.displayName, )", "Unexpected whitespace.")]
[InlineData("filter", "some", "Filter function expected.")]
[InlineData("filter", "equals", "( expected.")]
[InlineData("filter", "equals'", "Unexpected ' outside text.")]
[InlineData("filter", "equals(", "Count function or field name expected.")]
[InlineData("filter", "equals('1'", "Count function or field name expected.")]
[InlineData("filter", "equals(count(posts),", "Count function, value between quotes, null or field name expected.")]
[InlineData("filter", "equals(owner..displayName,'')", "Count function or field name expected.")]
[InlineData("filter", "equals(owner.displayName.,'')", "Count function or field name expected.")]
[InlineData("filter", "equals(title,')", "' expected.")]
[InlineData("filter", "equals(title,null", ") expected.")]
[InlineData("filter", "equals(null", "Field 'null' does not exist on resource type 'blogs'.")]
Expand Down