Skip to content

Internal Server Error in /V1/carts/mine/items API Endpoint #35937

Open
@mlf20

Description

@mlf20

Preconditions and environment

  • Magento version 2.4

Steps to reproduce

  1. Retrieve auth token from the admin endpoint /V1/integration/admin/
  2. Request endpoint:
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer' <AUTH TOKEN> -d '{"cartItem": ""}' -X POST http://<MAGENTO_URL>/pub/rest/default/V1/carts/mine/items

Expected result

Returns a 400 error as the request is malformed.

Actual result

Returns a 500 status code from a null TypeError .

Additional information

output of var/log/system.log:

	[2022-08-10T14:35:35.712804+00:00] main.CRITICAL: TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in /magento/vendor/magento/module-webapi/Controller/Rest/ParamsOverrider.php:122
	Stack trace:
	#0 /magento/vendor/magento/module-webapi/Controller/Rest/ParamsOverrider.php(122): array_key_exists()
	#1 /magento/vendor/magento/module-webapi/Controller/Rest/ParamsOverrider.php(68): Magento\Webapi\Controller\Rest\ParamsOverrider->setNestedArrayValue()
	#2 /magento/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(146): Magento\Webapi\Controller\Rest\ParamsOverrider->override()
	#3 /magento/generated/code/Magento/Webapi/Controller/Rest/InputParamsResolver/Interceptor.php(32): Magento\Webapi\Controller\Rest\InputParamsResolver->getInputData()
	#4 /magento/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(115): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->getInputData()
	#5 /magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()
	#6 /magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->___callParent()
	#7 /magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->Magento\Framework\Interception\{closure}()
	#8 /magento/generated/code/Magento/Webapi/Controller/Rest/InputParamsResolver/Interceptor.php(23): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->___callPlugins()
	#9 /magento/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(85): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->resolve()
	#10 /magento/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
	#11 /magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
	#12 /magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
	#13 /magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
	#14 /magento/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
	#15 /magento/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
	#16 /magento/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
	#17 /magento/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
	#18 /magento/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
	#19 {main} [] []

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Area: APIsComponent: ApiUse with concrete module component label E.g. "Component: Api" + "Catalog"Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions