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

Y24-213 - Remove use of default_includes in API v2 resources and the underlying support for it #4233

Open
sdjmchattie opened this issue Jul 25, 2024 · 0 comments

Comments

@sdjmchattie
Copy link
Contributor

Summary

A decent number of our JSONAPI::Resources use default_includes for things like :uuid_object and this probably worked 7 years ago when it was added, but this is no longer true.

What are we doing?

In many resources, one example of which is PlateTemplateResource, we are using a method which we added to BaseResource to record which related records we should include when a request is made for the resource. These default includes are then recorded via an inclusions method and used to modify the behaviour of apply_includes which JSONAPI::Resources is supposed to call when it wants to find out which related resources to include in a response.

How do we know it's no longer needed?

As can be seen in the upgrade checker rake task for JSONAPI::Resources, they no longer call the apply_includes method which is the core of our default_includes functionality. So our implementation does nothing.

What needs to happen?

  • Strip out all the code from BaseResource that handles the storing of default_includes and directs it through to the override of apply_includes. We should not be overriding that deprecated method any more.
  • Remove default_includes from any resources that are specifying it.
  • Check every one of those resources to ensure that the response is unchanged after the above changes.
@psd-issuer psd-issuer bot changed the title Remove use of default_includes in API v2 resources and the underlying support for it Y24-213 - Remove use of default_includes in API v2 resources and the underlying support for it Jul 25, 2024
@sdjmchattie sdjmchattie changed the title Y24-213 - Remove use of default_includes in API v2 resources and the underlying support for it Y24-213 - Remove use of default_includes in API v2 resources and the underlying support for it Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants