OData / odataorg.github.io

Staging site and collaboration repository for http://www.odata.org
MIT License
63 stars 101 forks source link

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

Open eltoroit opened 1 month ago

eltoroit commented 1 month ago

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.

mikepizzo commented 3 weeks ago

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 commented 3 weeks ago

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