Skip to content

Commit 14c1f9e

Browse files
authored
Merge pull request #10035 from magento-cia/AC-15346-249-alpha3
AC-15346-249-alpha3: WebAPI Enhancement
2 parents 933be4d + a1280f0 commit 14c1f9e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -246,6 +246,13 @@ private function getConstructorData(string $className, array $data): array
246246
if (isset($data[$parameter->getName()])) {
247247
$parameterType = $this->typeProcessor->getParamType($parameter);
248248

249+
// Allow only simple types or Api Data Objects
250+
if (!($this->typeProcessor->isTypeSimple($parameterType)
251+
|| preg_match('~\\\\?\w+\\\\\w+\\\\Api\\\\Data\\\\~', $parameterType) === 1
252+
)) {
253+
continue;
254+
}
255+
249256
try {
250257
$res[$parameter->getName()] = $this->convertValue($data[$parameter->getName()], $parameterType);
251258
} catch (\ReflectionException $e) {

0 commit comments

Comments
 (0)