Replies: 4 comments
-
Addition: Even adding |
Beta Was this translation helpful? Give feedback.
-
We're using An ApiProperty can not be used outside an ApiResource (for example it'll work with the trait when used in an ApiResource) |
Beta Was this translation helpful? Give feedback.
-
OK, I must correct this. Traits seem to be working fine. And ApiProperty() annotation, so far, seem to be too. I can't reproduce the original problem leading to this pr right now. In one case, it helped to remove the ApiProperty annotation in a child, reloading the documentation, and then pasting it back in, and there it was (caching..)? However:
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
API Platform version(s) affected: 2.5.0
Description
Inheritance of Serializer @groups or @ApiProperty items seems not to be honoured when extending classes or adding Traits to a class.
How to reproduce
Example class:
Classes extending this one have correct fields in Doctrine, but the ApiPlatform Groups and other annotations in ApiProperty are not honored.
The same happens if I add properties and getters/setters via a a corresponding Trait, e.g.
I would expect the annotations to be carried on into all children.
Beta Was this translation helpful? Give feedback.
All reactions