Skip to content

Check input data for nullable id #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.5] - 2025-03-24

### Fixed
- Check nullable input id value in Resource Object

## [0.0.4] - 2025-03-20

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

[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.4...HEAD
[Unreleased]: https://github.com/FreeElephants/json-api-dto/compare/0.0.5...HEAD
[0.0.5]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.5
[0.0.4]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.4
[0.0.3]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.3
[0.0.2]: https://github.com/FreeElephants/json-api-dto/releases/tag/0.0.2
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"suggest": {
"free-elephants/di": "*",
"nyholm/psr7": "^1.2"
"nyholm/psr7": "^1.2",
"zircote/swagger-php": "*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AbstractResourceObject

public function __construct(array $data)
{
$this->id = $data['id'];
$this->id = $data['id'] ?? null;
$this->type = $data['type'];

$concreteClass = new \ReflectionClass($this);
Expand Down