Skip to content

add snake case param name #15

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

Conversation

sarron93
Copy link
Contributor

@sarron93 sarron93 commented Nov 13, 2022

Description (*)

If we created service interface when have method public function importQty(object $productQty)
after send bulk request via url rest/async/bulk/V1/my_module/qtyUpdate include body
[ { "product_qty": { "template_id": 11831, "sku": "SKU0000100863", "qty": 13.0 } }, { "product_qty": { "template_id": 11821, "sku": "SKU0000138399", "qty": 13.0 } } ] then we get 202 status code and response text
{ "bulk_uuid": "942a14e7-431f-4a68-8009-2d1671b90eed", "request_items": [ { "id": 0, "data_hash": "64172f83f6b3955c91b4ed80117d6d26b4b3f81be61371b2e4c1769c6c93cf1f", "status": "accepted" }, { "id": 1, "data_hash": "132179362258e95fad607d91cbb96c7300c7620c3665fcff3476146625189557", "status": "accepted" } ], "errors": false }
after we send get request on url rest/V1/bulk/7e989285-c171-4c7b-b9c1-f3d77a7459cc/status and see this error
{ "operations_list": [ { "id": 0, "status": 3, "result_message": "Data item corresponding to \"productQty\" must be specified in the message with topic \"async.utires.odoointegration.api.productimportmanagementinterface.importqty.post\".", "error_code": 0 }, { "id": 1, "status": 3, "result_message": "Data item corresponding to \"productQty\" must be specified in the message with topic", "error_code": 0 } ], "user_type": 1, "bulk_id": "7e989285-c171-4c7b-b9c1-f3d77a7459cc", "start_time": "2021-01-15 14:48:01", "user_id": 96, "operation_count": 2 }
because vendor/magento/framework-message-queue/MessageEncoder.php class doesn't use $snakeCaseParamName variable how vendor/magento/framework/Webapi/ServiceInputProcessor.php

Manual testing scenarios (*)

  1. we sent [ { "product_qty": { "template_id": 11831, "sku": "SKU0000100863", "qty": 13.0 } }, { "product_qty": { "template_id": 11821, "sku": "SKU0000138399", "qty": 13.0 } } ] we get Service execution success

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] add snake case param name magento/magento2#31882: add snake case param name

@sarron93 sarron93 requested a review from a team as a code owner November 13, 2022 07:57
@Vinai Vinai closed this Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] add snake case param name
2 participants