API Platform version(s) affected: 3.3.11 (didn't checked earlier versions)
Description
The ExtractorPropertyMetadataFactory creates metadata with invalid builtin types when updating the "parent metadata" built by the next factory in the chain.
How to reproduce
Have an ApiResource with a typed property and setup the chain of factories so that the ExtractorPropertyMetadataFactory delegates to another one, like PropertyInfoPropertyMetadataFactory.
Additional Context
Output of the terminal with the error we originally got:
To reproduce this, it's also probably needed to add a validation constraint on the property. To be honest, I didn't checked.
After identifying that the issue came from the extractor factory, validating the possible solution by updating the method directly in the "vendor" directory.
We just implemented a decorator around the extractor we use to convert the types if needed.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
API Platform version(s) affected: 3.3.11 (didn't checked earlier versions)
Description
The
ExtractorPropertyMetadataFactory
creates metadata with invalid builtin types when updating the "parent metadata" built by the next factory in the chain.How to reproduce
Have an ApiResource with a typed property and setup the chain of factories so that the
ExtractorPropertyMetadataFactory
delegates to another one, likePropertyInfoPropertyMetadataFactory
.Possible Solution
Update
ExtractorPropertyMetadataFactory::update(ApiProperty $propertyMetadata, array $metadata): ApiProperty
to convert the builtin types found in$metadata
(the one extracted) intoType
objects. This is already done but only when there was no "parent metadata": https://github.com/api-platform/core/blob/7110dc665bde47b15dcfe8b1e3198427f8a78938/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php#L62-L64Additional Context
Output of the terminal with the error we originally got:
To reproduce this, it's also probably needed to add a validation constraint on the property. To be honest, I didn't checked.
After identifying that the issue came from the extractor factory, validating the possible solution by updating the method directly in the "vendor" directory.
We just implemented a decorator around the extractor we use to convert the types if needed.