fix(serializer): discriminated input patch fix - #8427
Conversation
… DTO subclass When an operation uses a plain (non-ApiResource) input DTO carrying a Serializer DiscriminatorMap, the normalizer pins resource_class to the abstract input base. The discriminator resolves the concrete subclass for instantiation, but constructor/setter argument metadata was still read from the abstract base, so an object-typed argument declared only on the subclass resolved to no type and its nested payload was passed as a raw array, triggering a TypeError (HTTP 500). Pin resource_class to the discriminator-resolved concrete class on the input path so subclass-only argument types are found and denormalized. Regression from api-platform#7779 (4.2.17). Fixes api-platform#8414
|
Thanks — reviewed this against #8424 and this PR supersedes it: your branch already carries soyuka's commit One change requested before merge: $concreteClass = null !== $objectToPopulate ? $objectToPopulate::class : $type;Please use
Non-blocking, but worth a look while you are in there: the new |
Additional merge PATCH fix on top of #8424