From 5c4f21f91d3bdd37621d9bd1617289c3275d4995 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Sat, 29 Jul 2023 15:01:59 +0100 Subject: [PATCH 1/2] Structure of response - Adjusted the structure of the permitted user response. --- app/Transformer/PermittedUser.php | 8 ++++--- public/api/schema/permitted-user.json | 30 +++++++++++++++++---------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/app/Transformer/PermittedUser.php b/app/Transformer/PermittedUser.php index 1b744435..49f61220 100644 --- a/app/Transformer/PermittedUser.php +++ b/app/Transformer/PermittedUser.php @@ -15,9 +15,11 @@ public function format(array $to_transform): void { $this->transformed = [ 'id' => $this->hash->permittedUser()->encode($to_transform['permitted_user_id']), - 'user_id' => $this->hash->user()->encode($to_transform['permitted_user_user_id']), - 'name' => $to_transform['permitted_user_name'], - 'email' => $to_transform['permitted_user_email'], + 'user' => [ + 'id' => $this->hash->user()->encode($to_transform['permitted_user_user_id']), + 'name' => $to_transform['permitted_user_name'], + 'email' => $to_transform['permitted_user_email'] + ], 'created' => $to_transform['permitted_user_created_at'] ]; } diff --git a/public/api/schema/permitted-user.json b/public/api/schema/permitted-user.json index d72ade5f..0b57aa30 100644 --- a/public/api/schema/permitted-user.json +++ b/public/api/schema/permitted-user.json @@ -5,14 +5,24 @@ "id": { "type": "string" }, - "user_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "email": { - "type": "string" + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "email" + ] }, "created": { "type": "string" @@ -20,9 +30,7 @@ }, "required": [ "id", - "user_id", - "name", - "email", + "user", "created" ] } From 9df6060e11ff74b867a2253e220f7a8a9bab737b Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Sat, 29 Jul 2023 15:02:21 +0100 Subject: [PATCH 2/2] Release - Set the release date and version and updated the changelog --- CHANGELOG.md | 4 ++++ config/api/app/version.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6d2882d..534eac16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ The complete changelog for the Costs to Expect REST API, our changelog follows the format defined at https://keepachangelog.com/en/1.0.0/ +## [v3.14.2] - 2023-07-29 +### Fixed +- Adjusted the structure of the collection for permitted users, user should be an object. + ## [v3.14.1] - 2023-07-28 ### Fixed - User id not included in the permitted users responses. diff --git a/config/api/app/version.php b/config/api/app/version.php index f0e5be78..ba6db8e0 100644 --- a/config/api/app/version.php +++ b/config/api/app/version.php @@ -3,9 +3,9 @@ declare(strict_types=1); return [ - 'version'=> 'v3.14.1', + 'version'=> 'v3.14.2', 'prefix' => 'v3', - 'release_date' => '2023-07-28', + 'release_date' => '2023-07-29', 'changelog' => [ 'api' => '/v3/changelog', 'markdown' => 'https://github.com/costs-to-expect/api/blob/master/CHANGELOG.md'