generate setter for simple arrays option #434
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Generate setter method instead of adder and remover for simple arrays option for backward compatibility turned off by default.
Having adder and remover denormalization of simple arrays needs usage of reflection based PropertyNormalizer to keep sent keys (to reset keys in fact), because array can't be just replaced with new one using entity interface and this is needed for proper item indexing in validation message and json serialization for example on Mercure pushes usage (arrays are serialized as json object not as arrays), ex:
If valid value is sent (ex. 'test3@example.com') and it is used in mercure push it is serialized as json object
{"1": "test1@example.com"}
in request body however on the frontend site by OpenApi/ Hydra docs we expects an array so without custom handling it crash on array operations (ex.project.shareWith.map(//...)
).