-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#8810 - REST API - Attribute option creation -> no ID returned #12920
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
#8810 - REST API - Attribute option creation -> no ID returned #12920
Conversation
Hi @sanjay-wagento, a few functional tests are failing and have to be adjusted because the result is not
It would be awesome if you are able to fix this. If not, please let us know. Thanks! |
…st-api-attribute-option-creation
…rest-api-attribute-option-creation
@sanjay-wagento Short update: results of the performance test suite indicate this change might cause a performance degradation. We are investigating at the moment. |
@@ -29,7 +29,7 @@ public function getItems($attributeCode); | |||
* @param \Magento\Eav\Api\Data\AttributeOptionInterface $option | |||
* @throws \Magento\Framework\Exception\StateException | |||
* @throws \Magento\Framework\Exception\InputException | |||
* @return bool | |||
* @return \Magento\Eav\Api\Data\AttributeOptionInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please return the option ID instead of object
@@ -20,7 +20,7 @@ | |||
* @param \Magento\Eav\Api\Data\AttributeOptionInterface $option | |||
* @throws \Magento\Framework\Exception\StateException | |||
* @throws \Magento\Framework\Exception\InputException | |||
* @return bool | |||
* @return \Magento\Eav\Api\Data\AttributeOptionInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please return the option ID instead of object
…to/2.3-feature-rest-api-attribute-option-creation
Hi @sanjay-wagento. Thank you for your contribution. |
Hi all involved Something seems to have gone wrong here. In Magento 2.2-develop, when you create a new attribute option using the REST API, it returns either:
In Magento 2.3-develop, when you create a new attribute option using the REST API, it returns either:
The purpose of this PR (correct me if I'm wrong) was to return either:
Reading @okorshenko remarks, I think the following needed to be returned (but might be wrong about that):
After git bisecting, it looks like 5eef1d9 caused the problem. So what was ultimately decided what needed to be returned? I assume Would be great if either @sanjay-wagento or @sidolov could review and make sure that the correct thing happens here. If I need to turn this into a new issue, please let me know. Thanks! |
@hostep You are correct as original discussion was not to just return the id but the complete option data. I still believe that it should return the complete option data. |
Set option_id in value field to attributeoptioninterface return type
Description
I have changed return type of add function and set value to option. So when we do REST or SOAP api then it will return option_id in 'value' field to attributeoptioninterface return type.
Fixed Issues (if relevant)
Manual testing scenarios
POST /rest/default/V1/products/attributes/manufacturer/options
with following Body:
{ "option": { "label": "Manufacturer 1" } }
Contribution checklist