Skip to content

Commit 8eb7a37

Browse files
fix: correctly remove self link when it is false (#648)
1 parent 86e9dba commit 8eb7a37

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/basics/schemas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ class Schema extends SchemaProvider
392392
{
393393
// ...
394394

395-
public function getResourceLinks($resource): ?array
395+
public function getResourceLinks($resource): iterable
396396
{
397-
return null;
397+
return ['self' => false];
398398
}
399399
}
400400
```

src/Schema/Schema.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public function getLinks($resource): iterable
123123
$links[LinkInterface::SELF] = $this->getSelfLink($resource);
124124
}
125125

126+
if ($self === false) {
127+
unset($links[LinkInterface::SELF]);
128+
}
129+
126130
return $links;
127131
}
128132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy