Problem/Motivation
Some normalizers, e.g. those provided by extras, need this context.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork jsonapi_schema-3318230
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
wim leersCan you point to a more concrete example?
Other than that minor gripe: I see no harm in doing this, especially for a module in the early stages like this one.
Comment #4
bradjones1The example would be an extras field enhancer that either includes metadata that varies on the bundle or entityid, or needs those contexts to compute the value, or do other transformations.
Comment #5
wim leersMakes sense — and by passing it in as context, the entity does not need to be loaded again 👍
Comment #6
bradjones1Yeah I mean ideally we could just get the specific field item list being normalized, however it's not (no longer?) in context from the caller.
Comment #7
m.stentaWe have automated tests now (#3257911: Add basic test coverage) so it would be good to include a test to demonstrate this issue and prevent regressions.