From 0fa8d0d98c35eea277c794be9d3adcd8f1fbca45 Mon Sep 17 00:00:00 2001 From: "n.gnato" Date: Mon, 24 Mar 2025 13:12:06 +0300 Subject: [PATCH 1/3] Check input data for nullable id --- src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php b/src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php index 18acd71..0cf59b2 100644 --- a/src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php +++ b/src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php @@ -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); From 7f7395975126c01effb6e67fdec13cfa42413632 Mon Sep 17 00:00:00 2001 From: "n.gnato" Date: Mon, 24 Mar 2025 13:15:10 +0300 Subject: [PATCH 2/3] Prepare next release --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f2eefe..656d0fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 From ac22a704bcd61625bf3fbdade26c920bb0872c9a Mon Sep 17 00:00:00 2001 From: "n.gnato" Date: Mon, 24 Mar 2025 13:18:02 +0300 Subject: [PATCH 3/3] Suggest openapi lib --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 423f0ac..e23c5d9 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ }, "suggest": { "free-elephants/di": "*", - "nyholm/psr7": "^1.2" + "nyholm/psr7": "^1.2", + "zircote/swagger-php": "*" }, "autoload": { "psr-4": {