Skip to content

Commit

Permalink
hydra context url
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Dassonville committed Oct 7, 2024
1 parent 7e28f19 commit f8dc31e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Hydra/Serializer/DocumentationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ private function computeDoc(Documentation $object, array $classes, string $hydra
private function getContext(string $hydraPrefix = ContextBuilder::HYDRA_PREFIX): array
{
return [
ContextBuilderInterface::HYDRA_CONTEXT_NS,
ContextBuilderInterface::HYDRA_CONTEXT,
[
'@vocab' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT], UrlGeneratorInterface::ABS_URL).'#',
'hydra' => ContextBuilderInterface::HYDRA_NS,
Expand Down
2 changes: 1 addition & 1 deletion src/JsonLd/ContextBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function getResourceContextWithShortname(string $resourceClass, int $ref
}

if (false === ($this->defaultContext[self::HYDRA_CONTEXT_HAS_PREFIX] ?? true) || $operation instanceof Error) {
return ['http://www.w3.org/ns/hydra/context.jsonld', $context];
return [ContextBuilderInterface::HYDRA_CONTEXT, $context];
}

return $context;
Expand Down
2 changes: 1 addition & 1 deletion src/JsonLd/ContextBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
interface ContextBuilderInterface
{
public const HYDRA_CONTEXT_NS = 'http://www.w3.org/ns/hydra/context.jsonld';
public const HYDRA_CONTEXT = 'http://www.w3.org/ns/hydra/context.jsonld';
public const HYDRA_NS = 'http://www.w3.org/ns/hydra/core#';
public const JSONLD_NS = 'http://www.w3.org/ns/json-ld#';
public const RDF_NS = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
Expand Down

0 comments on commit f8dc31e

Please sign in to comment.