Skip to content
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

?$expand does not work properly #29

Open
nigel-dewar opened this issue Feb 24, 2018 · 5 comments
Open

?$expand does not work properly #29

nigel-dewar opened this issue Feb 24, 2018 · 5 comments

Comments

@nigel-dewar
Copy link

nigel-dewar commented Feb 24, 2018

Expand seems to be broken on both of these examples

https://github.com/jaystack/odata-v4-server-mongodb-example
https://github.com/jaystack/odata-v4-server-mssql-example

If you visit http://services.odata.org/V4/ samples and use the following url

http://services.odata.org/V4/(S(ggb5l0d13uzsg0ro2qgrpoa4))/TripPinServiceRW/People?$expand=Trips

You will see you can get People and also their Trips

But if you try to do a similar query with odata-v4-server it breaks. For example

this breaks

http://localhost:3000/Products?$expand=Category

The console pumps out this error ( Im using the SQL server example in this case )

image

(node:10068) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'length' of undefined
(node:10068) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I can see the navigation property for Category is indeed there
image

Is this a bug, or am I not using this navigation property the way its intended? Is there some kind of Containment property that needs to be included on the NavigationProperty?

I did notice the navigation property in the services.odata.org sample is different, and includes a ContainsTarget property.

image

My details

Windows 10 Pro x64
Node version 8.1.1
npm version 5.0.3

The MS SQL Server sample has the following dependencies

"devDependencies": {
"@types/express": "^4.0.34",
"@types/mssql": "^3.1.30",
"chai": "^3.5.0",
"mocha": "^3.2.0",
"mochawesome": "^1.5.4",
"typescript": "^2.0.10"
},
"dependencies": {
"express": "^4.14.0",
"msnodesqlv8": "^0.2.10",
"mssql": "^3.3.0",
"odata-v4-mssql": "^0.1.0",
"odata-v4-server": "^0.1.15"
}

@aetherity
Copy link

This is also true with the pgsql example.

@RinatMullayanov
Copy link

I have same problem.

@quocvc
Copy link

quocvc commented May 21, 2019

me too.

@sgiraldo62
Copy link

I have same problem. HELP ME

@hanyoujia
Copy link

Does anyone find a way to solve this issue? please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants