I found that specifying Magento\Framework\Api\ExtensionAttributesInterface
and the methods getExtensionAttributes
& setExtensionAttributes
in my Repository class:
namespace MY\MODULE\Api\Data;
use Magento\Framework\{
Api\ExtensibleDataInterface,
Api\ExtensionAttributesInterface,
Model\ResourceModel\Db\AbstractDb
};
/** @api */
interface MyModelInterface extends ExtensibleDataInterface
{
......
/** @return ExtensionAttributesInterface */
public function getExtensionAttributes(): ExtensionAttributesInterface;
/**
* @param ExtensionAttributesInterface
* @return CatalogProductIndexPriceLogModelInterface
*/
public function setExtensionAttributes(ExtensionAttributesInterface $extensionAttributes): CatalogProductIndexPriceLogModelInterface;
Was causing:
php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 6/7 [========================>---] 85% 36 secs 476.0 MiBErrors during configuration scanning:
ExtensionAttributesInterface
Invalid ExtensionInterface for nonexistent class ExtensionAInterface in file /home/www/projects/magento2/the-block-shop/src/app/code/Convert/MonitorIndexers/Api/Data/CatalogProductIndexPriceLogModelInterface.php
Total Errors Count: 1
Removing these from the my interface but keeping them in my concrete class then running:
rm -rf generated/ && php bin/magento setup:di:compile
Worked.