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

+2-2
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

+4
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)