In constructor inject dependency
protected $productAttInterface;
\Magento\Catalog\Api\ProductAttributeManagementInterface $productAttInterface
$this->productAttInterface=$productAttInterface;
and get all attributes of a specific attribute set
$attributeSetId=16;
//This is Attribute Set Id
return $this->productAttInterface->getAttributes($attributeSetId);
Now i want to get all attributes of a specific group . I make a group and add 5 attributes. I want to just get these 5 attributes not all. Can anyone guide me how get attributes of specific group by giving group_name or group_id ?