odataorg.github.io icon indicating copy to clipboard operation
odataorg.github.io copied to clipboard

{"error":{"code":"","message":"Value cannot be null.\r\nParameter name: source"}}

Open eltoroit opened this issue 1 year ago • 2 comments

I am trying to use the reference service https://services.odata.org/TripPinRESTierService form Salesforce, and the Airlines and Airports works well. But when I try to access the Person Object, I get this error:

{"error":{"code":"","message":"Value cannot be null.\r\nParameter name: source"}}

This is the query that is being made.

https://services.odata.org/TripPinRESTierService/(S(y5p3g0acttyshhhmucgq5fvb))/People?$filter=UserName eq 'angelhuffman'&$count=true&$select=AddressInfo,Age,Emails,FavoriteFeature,Features,FirstName,Gender,HomeAddress,LastName,MiddleName,UserName

I am assuming the primary key of that object is the Username.

eltoroit avatar Jun 07 '24 21:06 eltoroit

This error occurs because the Features property for angelhuffman is not initialized in the data, so it is null which is not allowed for a collection-valued property.

A simpler repo would be: /People?$select=Features

mikepizzo avatar Jul 10 '24 00:07 mikepizzo

Fixed by https://github.com/OData/ODataSamples/pull/223. Just needs to be deployed to services.odata.org.

mikepizzo avatar Jul 10 '24 00:07 mikepizzo