Skip to content

Broken REST result for empty object references #4991

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
wienczny opened this issue Jun 13, 2016 · 1 comment
Closed

Broken REST result for empty object references #4991

wienczny opened this issue Jun 13, 2016 · 1 comment
Assignees

Comments

@wienczny
Copy link

According to the Swagger documentation "extension_attributes" is a reference to an attributes object. If there are no extension attributes the API returns an empty array []. This is illegal according to the Swagger documentation. It has to be either null if there is no object attached or an object {}.

I found this using the Java Swagger client and a product request:

{
  "id": 1,
  "sku": "test",
  "name": "Test",
  "attribute_set_id": 4,
  "price": 12,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": "2016-04-30 11:02:24",
  "updated_at": "2016-06-10 12:47:19",
  "weight": 5,
  "extension_attributes": [],
  "product_links": [],
  "options": [],
  "media_gallery_entries": [],
  "tier_prices": [],
  "custom_attributes": [
    {
      "attribute_code": "meta_title",
      "value": "Test"
    },
    {
      "attribute_code": "meta_keyword",
      "value": "Test"
    },
    {
      "attribute_code": "meta_description",
      "value": "Test "
    },
    {
      "attribute_code": "category_ids",
      "value": [
        "2",
        "3"
      ]
    },
    {
      "attribute_code": "options_container",
      "value": "container2"
    },
    {
      "attribute_code": "required_options",
      "value": "0"
    },
    {
      "attribute_code": "has_options",
      "value": "0"
    },
    {
      "attribute_code": "url_key",
      "value": "test"
    },
    {
      "attribute_code": "tax_class_id",
      "value": "2"
    }
  ]
}

I had to modify the swagger definition because of #2310 to get this far.

@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

magento-engcom-team pushed a commit that referenced this issue Nov 8, 2019
[honey] MC-21570: PAT trend build broken on graphql
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