Skip to content

Nested includes, missing data #1255

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

Closed
Michielvv87 opened this issue Feb 6, 2023 · 2 comments
Closed

Nested includes, missing data #1255

Michielvv87 opened this issue Feb 6, 2023 · 2 comments

Comments

@Michielvv87
Copy link

I have an application, which we've recently updated to v5.1 of JsonApiDotNetcore

The API is consumed from a react application.

We have a call to a shift-employee endpoint, which returns specific shift-employee links. In the call, I also include the field shift.shiftEmployees, so basically it includes the shfit this shift employee is linked to, and also all the shift-employees linked to that shift.

In a previous version of the package, in the included tag, also the main data object was represented. Now it isn't anymore. In React it's missing data if you map only the shifts from the results.

Attached the JSON response, where employee id 305 is only in the data attribute, and not in the included.
response.json.txt

Is it possible to make the API include this item?

@bkoelman
Copy link
Member

bkoelman commented Feb 6, 2023

Yes, this was changed in #1195. The JSON:API spec was clarified to no longer allow this, and we adapted JADNC accordingly. There's no configuration setting to revert to the old behavior.

@Michielvv87
Copy link
Author

Thanks for the response, this makes things clear

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

No branches or pull requests

2 participants