Skip to content

GETing products REST API unconsistent extension_attributes results #5081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jpdata opened this issue Jun 17, 2016 · 4 comments
Closed

GETing products REST API unconsistent extension_attributes results #5081

jpdata opened this issue Jun 17, 2016 · 4 comments
Assignees

Comments

@jpdata
Copy link

jpdata commented Jun 17, 2016

Steps to reproduce

  1. Install Magento 2.0.7 with Sample Data
  2. Get all products with REST API for example GET /rest/V1/products?searchCriteria=

Expected result

  1. All products and every pruct with a produc_links array and every product_link with a extension_attributes array
    .

Actual result

  1. All products and every pruct with a produc_links array and every product_link with a extension_attributes but for some products it returns an array even empty [] for others with one element does return the single element (not in an array). It should return an array allways, regarding the number of elements returned.

Some time it returns:
"extension_attributes":[]
some times returns:
"extension_attributes":{"qty":0}

As I said it should allways return an array:

"extension_attributes":[{"qty":0}]

@choukalos
Copy link

Hi @jpdata this is a feature request. Current behavior of Magento relies on an extensible object to be plugged into a method. We plug in the extensible objects for the detailed single object calls. For GetList we do not do this as there would be a significant performance issue (system would have to loop through each object and call every extensible object for the current framework resulting in a large # of database calls).

@jpdata
Copy link
Author

jpdata commented Jun 20, 2016

I'm developing an app in C# and i'm trying to deserialize Json objets returned to a class generic as I could build it, but it fails since the deserialization utility i'm using (Json.NET) expects and array but there is a single objetct instead. Now I need to find a work around. :-P

Thank you very much.

@choukalos choukalos assigned choukalos and mbrinton01 and unassigned choukalos Jun 22, 2016
@choukalos
Copy link

Assigning to Mark to discussion with team.

@vkorotun vkorotun removed the CS label Aug 4, 2016
@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

The Magento 2 GitHub repository is used to capture code and documentation issues.

New feature requests and existing feature improvements should be submitted to the Magento 2 Feature Requests and Improvements forum.

This discussion is now available at Magento Forums.

magento-engcom-team pushed a commit that referenced this issue Dec 10, 2019
[arcticfoxes] B2B-284 : Stabilize community PR for Order Search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants