diff --git a/app/Http/Resources/PolicyResource.php b/app/Http/Resources/PolicyResource.php index a3061ec3..40b5fa8c 100644 --- a/app/Http/Resources/PolicyResource.php +++ b/app/Http/Resources/PolicyResource.php @@ -12,6 +12,8 @@ class PolicyResource extends JsonResource { * * @return array */ + public static $wrap = null; + public function toArray(Request $request): array { return [ 'metadata' => [ diff --git a/tests/Http/Controllers/PolicyControllerTest.php b/tests/Http/Controllers/PolicyControllerTest.php index b3527248..56829d65 100644 --- a/tests/Http/Controllers/PolicyControllerTest.php +++ b/tests/Http/Controllers/PolicyControllerTest.php @@ -23,6 +23,14 @@ public function testGetPolicyByTypeAndActiveFrom(): void { $request = $this->getJson('v1/policies/hosting-policy/by_active_from/2026-07-01'); $request->assertOk(); + $request->assertJsonStructure([ + 'metadata' => [ + 'policy_id', + 'active_from', + 'content_vue_file', + 'type', + ], + ]); $request->assertJsonFragment([ 'active_from' => '2026-07-01', 'type' => 'hosting-policy',