-
-
Notifications
You must be signed in to change notification settings - Fork 940
Closed
Labels
Description
Problem
In my application I use the KnpDictionaryBundle. This bundle provide an interface to implement dictionaries but no resource class (but provide a dictionary registry), which is incompatible with api platform ATM.
I think api platform should authorize interface as a resource because I'm pretty sure it's not the only software to act like this.
Solution
Modify the ExtractorResourceMetadataFactory to support interfaces:
// before
if (!class_exists($resourceClass) || !$resource = $this->extractor->getResources()[$resourceClass] ?? false)
// After
if (!(class_exists($resourceClass) || interface_exists($resourceClass)) || !$resource = $this->extractor->getResources()[$resourceClass] ?? false)What do you think?