Hey,
It's a pretty common use case to allow an API consumer to write a PK of a resource on creation. This allows, amongst other things, asynchronous api endpoints which the consumer can then poll, as they know the ID of their resource.
This code currently prevents this:
|
if (isset($data['id']) && !isset($context[self::OBJECT_TO_POPULATE])) { |
|
if (isset($context['api_allow_update']) && true !== $context['api_allow_update']) { |
|
throw new InvalidArgumentException('Update is not allowed for this operation.'); |
|
} |
Does anyone know the intention of this code?
I'm pretty sure it can be safely adapted for the above use case, but just want some feedback before hand.
Thanks
Hey,
It's a pretty common use case to allow an API consumer to write a PK of a resource on creation. This allows, amongst other things, asynchronous api endpoints which the consumer can then poll, as they know the ID of their resource.
This code currently prevents this:
core/src/Serializer/ItemNormalizer.php
Lines 35 to 38 in c0de241
Does anyone know the intention of this code?
I'm pretty sure it can be safely adapted for the above use case, but just want some feedback before hand.
Thanks