Skip to content

Commit 17c0234

Browse files
author
n.gnato
committed
Prepare v0.0.7
1 parent 02bb330 commit 17c0234

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.0.7] - 2025-06-26
10+
11+
### Fixed
12+
- `attributes` and `relationships` fields optional in resource object, according to jsonapi v1.1#7.2.
13+
914
## [0.0.6] - 2025-04-05
1015

1116
### Fixed
@@ -37,7 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3742
### Added
3843
- Extract all DTO types from FreeElephants/json-api-php-toolkit to this project
3944

40-
[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.6...HEAD
45+
[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.7...HEAD
46+
[0.0.7]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.7
4147
[0.0.6]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.6
4248
[0.0.5]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.5
4349
[0.0.4]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.4

src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(array $data)
3131
$this->attributes = new $attributesClass($data['attributes']);
3232
}
3333

34-
if (property_exists($this, 'relationships')) {
34+
if (property_exists($this, 'relationships') && array_key_exists('relationships', $data)) {
3535
$relationshipsData = $data['relationships'];
3636
$concreteClass = new \ReflectionClass($this);
3737
$relationshipsProperty = $concreteClass->getProperty('relationships');

0 commit comments

Comments
 (0)