-
-
Notifications
You must be signed in to change notification settings - Fork 158
HasManyThrough always returns data:null but includes returns data #491
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
Comments
@wisepotato Were you able to get data with api/v1/articles/1/tags as well as api/v1/articles/1?include=tags (after you fixed it?) |
Is there a specific issue you are referring to? This could very well not be implemented yet, my issue was about tags needing to be filtered via the |
It seems like it has been implemented based on issue #453 which sounds like the same issue solved. |
@sarahentzel did you manage to work this out? Is this still an issue? |
It is still an issue. |
OK, we're currently working on releasing a new version, should be finished somewhere this week. Will look into this after that. If you could meanwhile make a branch/pr with a test that reproduces the exact error, it would greatly aid me in quickly fixing it :-) |
Permission to json-api-dotnet/JsonApiDotNetCore.git denied to sarahentzel |
You can fork the current repository, and then create a pull request, it will show us the test |
Looks like the issue is in ResourceGraph.cs Looks like the variabe "navigationProperty" does not reflect the one specified by [HasManyThrough(nameof(...)] attribute on the original entity. |
On the current master branch, I cannot reproduce the originally posted problem. GET http://localhost:1479/api/v1/articles/1/tags HTTP/1.1 {
"links": {
"self": "http://localhost:1479/api/v1/articles/1/tags"
},
"data": [
{
"type": "tags",
"id": "1",
"attributes": {
"name": "vrre051f7t"
},
"links": {
"self": "http://localhost:1479/api/v1/tags/1"
}
}
]
} GET http://localhost:1479/api/v1/articles/1?include=tags HTTP/1.1 {
"links": {
"self": "http://localhost:1479/api/v1/articles/1?include=tags"
},
"data": {
"type": "articles",
"id": "1",
"attributes": {
"name": "None for you Glen Coco"
},
"relationships": {
"author": {
"links": {
"self": "http://localhost:1479/api/v1/articles/1/relationships/author",
"related": "http://localhost:1479/api/v1/articles/1/author"
}
},
"tags": {
"links": {
"self": "http://localhost:1479/api/v1/articles/1/relationships/tags",
"related": "http://localhost:1479/api/v1/articles/1/tags"
},
"data": [
{
"type": "tags",
"id": "1"
}
]
},
"identifiableTags": {
"links": {
"self": "http://localhost:1479/api/v1/articles/1/relationships/identifiableTags",
"related": "http://localhost:1479/api/v1/articles/1/identifiableTags"
}
}
},
"links": {
"self": "http://localhost:1479/api/v1/articles/1"
}
},
"included": [
{
"type": "tags",
"id": "1",
"attributes": {
"name": "vrre051f7t"
},
"links": {
"self": "http://localhost:1479/api/v1/tags/1"
}
}
]
} |
Description
Running the JsonApiDotNetCoreExample,
http://localhost:1479/api/v1/articles/1/tags
returns{"data":null}
buthttp://localhost:1479/api/v1/articles/1?include=tags
returns the tags:Environment
The text was updated successfully, but these errors were encountered: