cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 REST API search products custom attributes format

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento 2 REST API search products custom attributes format

I've a problem with the products search response. All the custom attributes are in the following format:

"custom_attributes": [
    {
      "attribute_code": "description",
      "value": "."
    },
    {
      "attribute_code": "short_description",
      "value": "."
    },
    {
      "attribute_code": "cost",
      "value": "1.5200"
    }
]

There is a way to get them in this format:

 

"custom_attributes": [
     "description": ".",
     "short_description": ".",
     "cost": "1.5200"
 ]

I know that i could create a new endpoint which return a new interface with all the attribute that I need, but I was wandering it there was a simpler solution.

 

Thanks