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

ExpressionLexer fix for parameter alias token in dotted expression #1085

Merged
merged 2 commits into from Mar 5, 2018

Conversation

Projects
None yet
2 participants
@biaol-odata
Member

biaol-odata commented Feb 16, 2018

Issues

This pull request fixes ODL 7.4.1 issue of parameter alias parsing in dotted expression.

Description

*ExpressionLexer gets confused when trying to parse ParameterAlias token from expression containing ".", which is intended for annotation, in parts outside of the identifier token *

Example stack trace (from WebAPI test):
Microsoft.OData.ODataException : Could not find a property named '@p' on type 'System.Web.OData.Query.Expressions.DataTypes'.
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.EndPathBinder.GeneratePropertyAccessQueryForOpenType(EndPathToken endPathToken, SingleValueNode parentNode)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.EndPathBinder.BindEndPath(EndPathToken endPathToken)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.MetadataBinder.BindEndPath(EndPathToken endPathToken)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.BinaryOperatorBinder.GetOperandFromToken(BinaryOperatorKind operatorKind, QueryToken queryToken)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.BinaryOperatorBinder.BindBinaryOperator(BinaryOperatorToken binaryOperatorToken)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.MetadataBinder.BindBinaryOperator(BinaryOperatorToken binaryOperatorToken)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.FilterBinder.BindFilter(QueryToken filter)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilterImplementation(String filter, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)
c:\github\WebApi-master\myWebApi\tools\WebStack.xunit.targets(12,9): error : at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilter()

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

@biaol-odata biaol-odata requested a review from mikepizzo Feb 16, 2018

@biaol-odata biaol-odata merged commit f023620 into OData:master Mar 5, 2018

2 checks passed

continuous-integration/vsts The build trigger has fired.
Details
license/cla All CLA requirements met.
Details

@biaol-odata biaol-odata deleted the biaol-odata:parameterAliasToken branch Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment