Skip to content

Commit 30f45b6

Browse files
authored
Merge pull request #6 from developerstudservis/nullable-RO-id
Check input data for nullable id
2 parents 9bfbcfb + ac22a70 commit 30f45b6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
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.5] - 2025-03-24
10+
11+
### Fixed
12+
- Check nullable input id value in Resource Object
13+
914
## [0.0.4] - 2025-03-20
1015

1116
### Changed
@@ -27,7 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2732
### Added
2833
- Extract all DTO types from FreeElephants/json-api-php-toolkit to this project
2934

30-
[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.4...HEAD
35+
[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.5...HEAD
36+
[0.0.5]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.5
3137
[0.0.4]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.4
3238
[0.0.3]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.3
3339
[0.0.2]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.2

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
},
2222
"suggest": {
2323
"free-elephants/di": "*",
24-
"nyholm/psr7": "^1.2"
24+
"nyholm/psr7": "^1.2",
25+
"zircote/swagger-php": "*"
2526
},
2627
"autoload": {
2728
"psr-4": {

src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AbstractResourceObject
1515

1616
public function __construct(array $data)
1717
{
18-
$this->id = $data['id'];
18+
$this->id = $data['id'] ?? null;
1919
$this->type = $data['type'];
2020

2121
$concreteClass = new \ReflectionClass($this);

0 commit comments

Comments
 (0)