-
-
Notifications
You must be signed in to change notification settings - Fork 928
Closed
Description
Hey there,
It appears that
@ApiProperty(writable=false)
is ignored when added to a property (it remains as true)
This is because the AnnotationPropertyMetadataFactory
refuses to overwrite an existing value if the decorated PropertyMetadataFactoryInterface
has already set it.
https://github.com/api-platform/core/blob/master/src/Metadata/Property/Factory/AnnotationPropertyMetadataFactory.php#L137-L138
It is already set here:
https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyMetadataFactory.php#L68
A few questions:
- Should later running
PropertyMetadataFactory
services overwrite the one they are decorating, or do earlier ones have priority? - What should be the order be of the
PropertyMetadataFactoryInterface
? Here is the current decoration order:
CachedPropertyMetadataFactory
:-10
ValidatorPropertyMetadataFactory
20
AnnotationSubresourceMetadataFactory
:30
SerializerPropertyMetadataFactory
:30
DoctrineOrmPropertyMetadataFactory
:40
AnnotationPropertyMetadataFactory
:40
PropertyInfoPropertyMetadataFactory
:40
InheritedPropertyMetadataFactory
:40
ExtractorPropertyMetadataFactory
:40
- Is it a problem that many of them have the same priority, as the order is not deterministic.
Metadata
Metadata
Assignees
Labels
No labels