Skip to content

Commit 30f0566

Browse files
fix(hydra): remove # in returns & expects fields
1 parent 099d9a4 commit 30f0566

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Hydra/Serializer/DocumentationNormalizer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,28 +280,28 @@ private function getHydraOperation(HttpOperation $operation, string $prefixedSho
280280
$hydraOperation += [
281281
'@type' => [$hydraPrefix.'Operation', 'schema:FindAction'],
282282
$hydraPrefix.'title' => "Retrieves a $shortName resource.",
283-
'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
283+
'returns' => null === $outputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
284284
];
285285
} elseif ('PATCH' === $method) {
286286
$hydraOperation += [
287287
'@type' => $hydraPrefix.'Operation',
288288
$hydraPrefix.'title' => "Updates the $shortName resource.",
289-
'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
290-
'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
289+
'returns' => null === $outputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
290+
'expects' => null === $inputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
291291
];
292292
} elseif ('POST' === $method) {
293293
$hydraOperation += [
294294
'@type' => [$hydraPrefix.'Operation', 'schema:CreateAction'],
295295
$hydraPrefix.'title' => "Creates a $shortName resource.",
296-
'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
297-
'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
296+
'returns' => null === $outputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
297+
'expects' => null === $inputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
298298
];
299299
} elseif ('PUT' === $method) {
300300
$hydraOperation += [
301301
'@type' => [$hydraPrefix.'Operation', 'schema:ReplaceAction'],
302302
$hydraPrefix.'title' => "Replaces the $shortName resource.",
303-
'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
304-
'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
303+
'returns' => null === $outputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
304+
'expects' => null === $inputClass ? 'owl:Nothing' : substr($prefixedShortName, 1),
305305
];
306306
} elseif ('DELETE' === $method) {
307307
$hydraOperation += [
@@ -430,7 +430,7 @@ private function getClasses(array $entrypointProperties, array $classes, string
430430
'@type' => $hydraPrefix.'Operation',
431431
$hydraPrefix.'method' => 'GET',
432432
'rdfs:label' => 'The API entrypoint.',
433-
'returns' => '#EntryPoint',
433+
'returns' => 'EntryPoint',
434434
],
435435
];
436436

0 commit comments

Comments
 (0)