Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /