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

Commit

Permalink
make fields optional by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Feb 23, 2022
1 parent 0ee68c2 commit 4b4f2c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commercetools-php-sdk-changelog",
"version": "2.17.0",
"version": "2.17.1-beta.1",
"description": "commercetools PHP SDK changelog generator package description",
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
"bugs": "https://github.com/commercetools/commercetools-php-sdk/issues",
Expand Down
2 changes: 1 addition & 1 deletion src/Core/AbstractHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
abstract class AbstractHttpClient
{
const VERSION = '2.17.0';
const VERSION = '2.17.1-beta.1';

/**
* @var AdapterInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Model/Common/JsonObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected function initialize($field)

public function isOptional($field)
{
return $this->fieldDefinitionValue($field, static::OPTIONAL, false);
return $this->fieldDefinitionValue($field, static::OPTIONAL, true);
}

protected function decorateField($field, $value)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Model/Common/JsonObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getObject()
->will(
$this->returnValue(
[
'key' => [JsonObject::TYPE => 'string'],
'key' => [JsonObject::TYPE => 'string', JsonObject::OPTIONAL => false],
'dummy' => [JsonObject::TYPE => 'string'],
'true' => [JsonObject::TYPE => 'bool'],
'false' => [JsonObject::TYPE => 'bool'],
Expand Down Expand Up @@ -243,7 +243,7 @@ public function testOptional()
$this->returnValue('12345')
);

$this->assertFalse($obj->isOptional('implicit'));
$this->assertTrue($obj->isOptional('implicit'));
$this->assertTrue($obj->isOptional('optional'));
$this->assertFalse($obj->isOptional('required'));
}
Expand Down

0 comments on commit 4b4f2c6

Please sign in to comment.