Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit d87a923

Browse files
committed
Merge branch '2.17.x'
2 parents 1f3acd7 + 3d8deef commit d87a923

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [2.17.1-beta.1](https://github.com/commercetools/commercetools-php-sdk/compare/v2.17.0...v2.17.1-beta.1) (2022-02-23)
2+
3+
### Bug Fixes
4+
5+
* **JsonObject** fields are marked optional by default
6+
17
# [2.17.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.16.0...v2.17.0) (2022-02-07)
28

39

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commercetools-php-sdk-changelog",
3-
"version": "2.17.0",
3+
"version": "2.17.1-beta.1",
44
"description": "commercetools PHP SDK changelog generator package description",
55
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
66
"bugs": "https://github.com/commercetools/commercetools-php-sdk/issues",

src/Core/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '2.17.0';
17+
const VERSION = '2.17.1-beta.1';
1818

1919
/**
2020
* @var AdapterInterface

src/Core/Model/Common/JsonObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected function initialize($field)
192192

193193
public function isOptional($field)
194194
{
195-
return $this->fieldDefinitionValue($field, static::OPTIONAL, false);
195+
return $this->fieldDefinitionValue($field, static::OPTIONAL, true);
196196
}
197197

198198
protected function decorateField($field, $value)

tests/unit/Model/Common/JsonObjectTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function getObject()
3535
->will(
3636
$this->returnValue(
3737
[
38-
'key' => [JsonObject::TYPE => 'string'],
38+
'key' => [JsonObject::TYPE => 'string', JsonObject::OPTIONAL => false],
3939
'dummy' => [JsonObject::TYPE => 'string'],
4040
'true' => [JsonObject::TYPE => 'bool'],
4141
'false' => [JsonObject::TYPE => 'bool'],
@@ -243,7 +243,7 @@ public function testOptional()
243243
$this->returnValue('12345')
244244
);
245245

246-
$this->assertFalse($obj->isOptional('implicit'));
246+
$this->assertTrue($obj->isOptional('implicit'));
247247
$this->assertTrue($obj->isOptional('optional'));
248248
$this->assertFalse($obj->isOptional('required'));
249249
}

0 commit comments

Comments
 (0)