You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue is similar to #2539, except for the use of square brackets rather than parenthesis. Also, issue happens for any regular property.
Assemblies affected
ODL version 8.0.1
Reproduce steps
// Setup basic modelvarmodel=new EdmModel();varuser= model.AddEntityType("graph","user", baseType:null, isAbstract:false, isOpen:true, hasStream:false);varcontainer= model.AddEntityContainer("graph","service");
container.AddEntitySet("users", user);// Setup URI parservarparser=new ODataUriParser(model,new System.Uri("/users?$filter=openPropertyFoo in ('')", System.UriKind.Relative));
parser.ParsePath();// This throws an ArgumentNullException:varfilter= parser.ParseFilter();
Expected result
Since syntax is not as expected, throw ODataException.
Actual result
Below exception is thrown.
System.ArgumentNullException: Value cannot be null or empty. (Parameter 'literalText')
at Microsoft.OData.ExceptionUtils.CheckArgumentStringNotNullOrEmpty(String value, String parameterName)
at Microsoft.OData.UriParser.ConstantNode..ctor(Object constantValue, String literalText, IEdmTypeReference typeReference)
at Microsoft.OData.UriParser.CollectionConstantNode..ctor(IEnumerable`1 objectCollection, String literalText, IEdmCollectionTypeReference collectionType)
at Microsoft.OData.UriParser.LiteralBinder.BindInLiteral(LiteralToken literalToken)
at Microsoft.OData.UriParser.MetadataBinder.<BindIn>b__22_0(QueryToken queryToken)
at Microsoft.OData.UriParser.InBinder.GetCollectionOperandFromToken(QueryToken queryToken, IEdmTypeReference expectedType, IEdmModel model)
at Microsoft.OData.UriParser.InBinder.BindInOperator(InToken inToken, BindingState state)
at Microsoft.OData.UriParser.MetadataBinder.BindIn(InToken inToken)
at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)
at Microsoft.OData.UriParser.FilterBinder.BindFilter(QueryToken filter)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilterImplementation(String filter, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilter()
at Microsoft.OData.UriParser.ODataUriParser.ParseFilter()
at MyPlayGround.Program.Main(String[] args) in C:\Users\sriramd\source\repos\MyPlayGround\Program.cs:line 25
The text was updated successfully, but these errors were encountered:
Clarification: repro URI from code snippet above is with square brackets: /users?$filter=openPropertyFoo in [""] or /users?$filter=openPropertyFoo in ['']
It occurs for both open and schema-defined properties (even a simple primary key property of type string).
Issue is similar to #2539, except for the use of square brackets rather than parenthesis. Also, issue happens for any regular property.
Assemblies affected
ODL version 8.0.1
Reproduce steps
Expected result
Since syntax is not as expected, throw ODataException.
Actual result
Below exception is thrown.
The text was updated successfully, but these errors were encountered: