File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/FreeElephants/JsonApi/DTO Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [ Unreleased]
8
8
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
+
9
14
## [ 0.0.6] - 2025-04-05
10
15
11
16
### Fixed
@@ -37,7 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
37
42
### Added
38
43
- Extract all DTO types from FreeElephants/json-api-php-toolkit to this project
39
44
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
41
47
[ 0.0.6 ] : https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.6
42
48
[ 0.0.5 ] : https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.5
43
49
[ 0.0.4 ] : https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.4
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public function __construct(array $data)
31
31
$ this ->attributes = new $ attributesClass ($ data ['attributes ' ]);
32
32
}
33
33
34
- if (property_exists ($ this , 'relationships ' )) {
34
+ if (property_exists ($ this , 'relationships ' ) && array_key_exists ( ' relationships ' , $ data ) ) {
35
35
$ relationshipsData = $ data ['relationships ' ];
36
36
$ concreteClass = new \ReflectionClass ($ this );
37
37
$ relationshipsProperty = $ concreteClass ->getProperty ('relationships ' );
You can’t perform that action at this time.
0 commit comments