Magento – Magento 2 extension attribute issue for Magento\Quote\Api\Data\AddressInterface

extension-attributesmagento2.2

i am trying to add extension attribute for Magento\Quote\Api\Data\AddressInterface but i am facing below issue.

Message: Property "Addressfiled" does not have corresponding setter in class "Magento\Quote\Api\Data\AddressExtensionInterface". 

Any one could you please provide solution for this.

Best Answer

Add the attribute to your extension_attributes.xml file:

<extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
    <attribute code="attribute_code_here" type="string" />
</extension_attributes>

After adding it you will have to run:

bin/magento setup:di:compile 

Hope it works