-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
[Question] Get details of Inherited instances #1138
Comments
Hi @Anthony-Michel, thanks for asking. Unfortunately, resource inheritance doesn't work very well in JADNC at the moment. It requires quite some work to provide a good and consistent experience, tracked in #844, which is on our roadmap. While we do have some basic tests here, #846 contains non-working scenarios we're aware of. For now, I'd advise to not use inheritance. However, if you want to continue with that, note we welcome PRs with small patches to unblock existing scenarios. Another way to move this forward is to provide feedback and/or suggestions to what's proposed in #844. |
Thank you for the quick answer. I don't really see a sustainable way i can get rid of the inheritance for this case to be honest, as the main use case is to be able to let Front end retrieve a list of LegalEntities and their specific details without knowing or filtering/sorting by type. Eventually, for this specific endpoint, i could do a mapping from my EF entities to a flatten version of the resource, as similar to this 6097476 |
Support for entity-resource-separation no longer exists since v4. It was dropped during early development of v4, because there were just too many corner cases that we couldn't get to work. You could try and remove Inheritance is a kind of relationship, so you can always model them to be JSON:API relationships instead. Unless you're willing to contribute fixes to JADNC, that sounds like the best way to move forward at this time. |
Already tried without abstract before posting here :) |
Closing as duplicate of #844. |
@Anthony-Michel please note the work being done in #1142. If you feel things should work differently, please let me know. |
@bart-degreed thank you for all the work that went into that, greatly appreciated. |
As i was passing by, just realized i forgot to give a feedback, so just for the sake of it, we integrated the new version some time after the last comments and it's working perfectly since. Once again thank you for all the work that went into it ! |
Glad to hear, thanks for the feedback! |
I have a structure with multiple resources inheriting from an abstract resource, serving as main entry point.
It's using EF Core Table-per-hierarchy and discriminator configuration.
a GetAll call give me only the common fields from the abstract resource.
I need to be able to retrieve the specific fields from each individual child types, and use them for filtering / sorting / selecting fieldsets.
I tried, as described in the documentation to configure specific Repositories or Services, without success.
Also saw an MR from 2018 describing how to add a mapping to the configuration, but it seems this logic is now removed.
Would you get any advice on how to best implement this ?
Some code sample:
EF Configuration:
Main Entity:
Controller:
JsonApi Config
The text was updated successfully, but these errors were encountered: