willdurand / BazingaHateoasBundle

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

Why the ExtensionDriver is only enabled for annotation driver? #85

Open videni opened 5 years ago

videni commented 5 years ago

        <service id="hateoas.configuration.metadata.extension_driver" class="%hateoas.configuration.metadata.extension_driver.class%" public="false">
            <argument type="service" id="hateoas.configuration.metadata.annotation_driver" />
        </service>

        <service id="hateoas.configuration.metadata.chain_driver" class="%jms_serializer.metadata.chain_driver.class%" public="false">
            <argument type="collection">
                <argument type="service" id="hateoas.configuration.metadata.yaml_driver" />
                <argument type="service" id="hateoas.configuration.metadata.xml_driver" />
                <argument type="service" id="hateoas.configuration.metadata.extension_driver" />
            </argument>
        </service>

I add a custom configuration extension, it never get executed, I found out that the ExtensionDriver is not enabled for yaml and xml driver, why is it?

goetas commented 5 years ago

Adding new extensions requires you to register them via hateoas.configuration_extension tag. Are you doing so?

It looks that all the drivers should be wrapped in a extension driver class (not only the annotations driver). Seems to be a legit bug.

A PR with the fix is welcome