magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

RESTful API: No way to discover attribute set / group / attribute information #193

Open gibbotronic opened 4 years ago

gibbotronic commented 4 years ago

Using the RESTful interface, there is no way to interrogate an attribute set to see which attributes are assigned to it by group.

This means I have no way of knowing whether an attribute should be assigned to an attribute set, so I must blindly and dumbly assign all my attributes to their respective attribute sets and groups every time I want to interact with them, as I have absolutely no way of knowing what already exists. eg. with a POST to rest/V1/products/attribute-sets/attributes with

{"attributeCode":"myNewAttribute", "attributeGroupId":1550, "attributeSetId":148, "sortOrder":0}
  1. You can discover all attributes via rest/V1/products/attributes?searchCriteria but this doesn't give any group information or attribute set relationship information.
  2. You can query an individual attribute via rest/V1/products/attributes/{attributeCode} (eg. rest/V1/products/attributes/color) but this does not give any group information or attribute set relationship information.
  3. You can search for all attribute sets via rest/V1/products/attribute-sets/sets/list?searchCriteria&fields=items but this does not give any group information.
  4. You can query an individual attribute set via its id (eg. 4 for Default, out of the box) via rest/V1/products/attribute-sets/4 but this does not give any group information or details on the attributes that belongs to this attribute set.
  5. You can query an individual attribute set via its id to discover the attributes within that set (eg. 4 for Default) via rest/V1/products/attribute-sets/4/attributes but this does not give any group information.
  6. You can query for all groups via rest/V1/products/attribute-sets/groups/list?searchCriteria but this does not tell you which attributes actually belong to the returned list of groups and attribute sets.
  7. There does not appear to be a way to fetch individual group information.

Preconditions (*)

  1. Magento 2.3.2

Steps to reproduce (*)

  1. There is no way of getting this information!

Expected result (*)

  1. I would like to be able to know the tuple of attribute set / group / attribute relationships.
  2. I would expect this somewhere under the attribute set API or under the attribute API

Actual result (*)

  1. This is impossible.
m2-assistant[bot] commented 4 years ago

Hi @gibbotronic. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@gibbotronic do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 4 years ago

Hi @engcom-Charlie. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Charlie commented 4 years ago

This issue looks like a feature request. @sdzhepa can you transfer this issue to the feature requests repository?

m2-assistant[bot] commented 4 years ago

Hi @sdzhepa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

gibbotronic commented 4 years ago

Thanks for adding this as a feature request - much appreciated. At the moment there is no way to get this data out of Magento via the API.

priti2jcommerce commented 4 years ago

@magento give me 2.3-develop instance - upcoming 2.3.x release

magento-engcom-team commented 4 years ago

Hi @priti2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you

magento-engcom-team commented 4 years ago

Hi @priti2jcommerce, here is your Magento instance. Admin access: https://i-24413-2-3-develop.instances.magento-community.engineering/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

sdzhepa commented 4 years ago

Based on the description and label feature request the issue has been transferred to Magento Feature Request public repo.