Skip to content

Commit bc423da

Browse files
committed
Fix manifest, replace the manifest self id with the route iri
1 parent 5aa184c commit bc423da

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Entity/Core/Route.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
1717
use ApiPlatform\Metadata\ApiFilter;
18-
use ApiPlatform\Metadata\ApiProperty;
1918
use ApiPlatform\Metadata\ApiResource;
2019
use ApiPlatform\Metadata\Delete;
2120
use ApiPlatform\Metadata\Get;

src/Serializer/Normalizer/RouteNormalizer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function normalize($object, $format = null, array $context = []): float|a
6565

6666
$operationName = $context['operation_name'] ?? null;
6767
if ('_api_/routes_manifest/{id}{._format}_get' === $operationName) {
68+
$normalized['@id'] = str_replace('routes_manifest', 'routes', $normalized['@id']);
6869
return [
6970
'resource_iris' => $this->getResourceIrisFromArray($normalized),
7071
];
@@ -105,7 +106,9 @@ private function getResourceIrisFromArray(array $resource, array $iris = []): ar
105106
}
106107
}
107108

108-
return $iris;
109+
return array_filter($iris, function($iri) {
110+
return !str_starts_with($iri, '/.well-known/');
111+
});
109112
}
110113

111114
public function supportsNormalization($data, $format = null, $context = []): bool

0 commit comments

Comments
 (0)