magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.58k stars 9.32k forks source link

Rest API response "page_size" missing in M2.4.4 #35310

Open anvanza opened 2 years ago

anvanza commented 2 years ago

Preconditions (*)

  1. Install a 2.4.3-p1

Steps to reproduce (*)

  1. On 2.4.3-p1 create a GET request to rest/all/V1/orders/?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=processing&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[currentPage]=1
  2. The response should return something like: Screenshot 2022-04-14 at 13 56 35
    {
    "items": [.....],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "status",
                        "value": "processing",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "page_size": 20,
        "current_page": 1
    },
    "total_count": 20
    }
  3. Try the same request on 2.4.4

Expected result (*)

  1. The metadata in the response should be the exact same on Magento 2.4.3-p1 and 2.4.4

Actual result (*)

  1. The page_size is missing Screenshot 2022-04-14 at 13 56 49
    {
    "items": [.....],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "status",
                        "value": "processing",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "current_page": 1
    },
    "total_count": 20
    }

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @anvanza. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

anvanza commented 2 years ago

@magento give me 2.4.3-p1 instance

magento-deployment-service[bot] commented 2 years ago

Hi @anvanza. Thank you for your request. I'm working on Magento instance for you.

anvanza commented 2 years ago

@magento give me 2.4.4 instance

magento-deployment-service[bot] commented 2 years ago

Hi @anvanza. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @anvanza, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

magento-deployment-service[bot] commented 2 years ago

Hi @anvanza, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

mackieee commented 2 years ago

@anvanza Do you have a figure filled in the new Web API input limits? (Found in Configuration -> Services -> Magento Web API).

image

Could attempt again upon setting your own Page size default?

anvanza commented 2 years ago

@mackieee , I found the default page size config field. Added 20 in there but the result is still the same. The page_size is still missing in the response.

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. 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-November commented 2 years ago

Hi @anvanza , Thank you for reporting and collaboration. Verified the behavior on Magento 2.4-develop branch and 2.4.4 version as well. and is reproducible. However, by setting searchCriteria[pageSize] in Params, issue is not reproducible. "page_size" retrieved in the response: image

As per dev docs as well, page_size is not retrieved In the example response, if it is not set in request. page_size is not retrieved in the response.

Same behavior can be observed in 2.4.3-p1 instance for "current_page" field.

Kindly recheck the behavior on Magento 2.4-develop branch / 2.4.4 version by sending request with "page_size" param and let us know if you are still facing issue. Thank you.

anvanza commented 2 years ago

Hi @engcom-November ,

True, On 2.4.4 the page_size is returned when searchCriteria[pageSize] is set. While on 2.4.3-p1 it returned page_size even when searchCriteria[pageSize] is not set.

engcom-November commented 2 years ago

Hi @anvanza,

We are moving this ticket to "On Hold" as we are awaiting confirmation from PO for expected behavior. Thank you.

Viktorja1 commented 2 years ago

@magento give me 2.4.4 instance

magento-deployment-service[bot] commented 2 years ago

Hi @Viktorja1. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @Viktorja1, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

engcom-Hotel commented 1 year ago

Hello @anvanza,

We have got reply from the PO, and as per him this is an issue but the page size is a part of any GET rest request that is a multi-entity response.

Even if not passed, the page size should be present, because the rest should have a fixed payload/schema.

Of course, this is not a blocker because they could include a simple logic to check for the existence of the key in the logic and just assume a default of pagesize= 20.

Hence confirming this issue for further processing.

Thanks

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-7878 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 year ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

quterorta commented 1 year ago

@magento I am working on this

GurramSravya commented 1 year ago

@magento I am working on this

m2-assistant[bot] commented 1 year ago

Hi @GurramSravya! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

GurramSravya commented 1 year ago

@magento add to contributors team

m2-assistant[bot] commented 1 year ago

Hi @GurramSravya! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

GurramSravya commented 1 year ago

@magento I am working on this

GurramSravya commented 1 year ago

@magento give me 2.4.4 instance

magento-deployment-service[bot] commented 1 year ago

Hi @GurramSravya. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @GurramSravya, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

GurramSravya commented 1 year ago

@magento give me 2.4.3-p1 instance

magento-deployment-service[bot] commented 1 year ago

Hi @GurramSravya. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @GurramSravya, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

GurramSravya commented 1 year ago

Hi @anvanza , The issue can be resolved by enabling the configuration from backend as

Stores->Configuration->Services->Magento Web Api->Web Api Input Limits->Enable Input Limits->Default Page Size

image image
anvanza commented 1 year ago

True, On 2.4.4 the page_size is returned when searchCriteria[pageSize] is set. While on 2.4.3-p1 it returned page_size even when searchCriteria[pageSize] is not set.

Same response as in 2022...

engcom-Delta commented 2 months ago

Hi @anvanza ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.

Steps to reproduce

  1. create a GET request to rest/all/V1/orders/?searchCriteria[filterGroups][0][filters][0][field]=status&searchCriteria[filterGroups][0][filters][0][value]=processing&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[currentPage]=1
  2. Observe page_size parameter is not displaying image
  3. However, by setting searchCriteria[pageSize] in Params, issue is not reproducible. image

Thanks.

github-jira-sync-bot commented 2 months ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-7878