willdurand / BazingaHateoasBundle

Integration of the Hateoas library into Symfony.
MIT License
294 stars 59 forks source link

Enable Metadata\MetadataFactory::setIncludeInterfaces() #93

Open lstrojny opened 3 years ago

lstrojny commented 3 years ago

Any particular reason why Metadata\MetadataFactory::setIncludeInterfaces() is not enabled per default and/or no setting exists. Would be cool to use interfaces for shared metadata.

lstrojny commented 3 years ago

I realized this might sound demanding, which is not what I meant. Much rather: has this been considered before?

goetas commented 3 years ago

jms serializer uses the same strategy, and since this library is just a plugin for the serializer, it has to follow the same.

On the other side, in jms that decision has been taken to avoid some unexpected behaviors when defining metadata (makes harder to override metadata). It has been used a simple rule "metadata are per-class" anything else (interfaces, traits) is just ignored.