Skip to content

Commit

Permalink
fix(hydra): context url in https
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-dassonville committed Oct 29, 2024
1 parent 001d771 commit 4f1cdfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion features/hydra/docs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: Documentation support
And the response should be in JSON
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
# Context
And the JSON node "@context[0]" should be equal to "http://www.w3.org/ns/hydra/context.jsonld"
And the JSON node "@context[0]" should be equal to "https://www.w3.org/ns/hydra/context.jsonld"
And the JSON node "@context[1].@vocab" should be equal to "http://example.com/docs.jsonld#"
And the JSON node "@context[1].hydra" should be equal to "http://www.w3.org/ns/hydra/core#"
And the JSON node "@context[1].rdf" should be equal to "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Expand Down
6 changes: 3 additions & 3 deletions src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function doTestNormalize($resourceMetadataFactory = null): void

$expected = [
'@context' => [
'http://www.w3.org/ns/hydra/context.jsonld',
'https://www.w3.org/ns/hydra/context.jsonld',
[
'@vocab' => '/doc#',
'hydra' => 'http://www.w3.org/ns/hydra/core#',
Expand Down Expand Up @@ -406,7 +406,7 @@ public function testNormalizeInputOutputClass(): void

$expected = [
'@context' => [
'http://www.w3.org/ns/hydra/context.jsonld',
'https://www.w3.org/ns/hydra/context.jsonld',
[
'@vocab' => '/doc#',
'hydra' => 'http://www.w3.org/ns/hydra/core#',
Expand Down Expand Up @@ -766,7 +766,7 @@ public function testNormalizeWithoutPrefix(): void

$expected = [
'@context' => [
'http://www.w3.org/ns/hydra/context.jsonld',
'https://www.w3.org/ns/hydra/context.jsonld',
[
'@vocab' => '/doc#',
'hydra' => 'http://www.w3.org/ns/hydra/core#',
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 = 'http://www.w3.org/ns/hydra/context.jsonld';
public const HYDRA_CONTEXT = 'https://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
2 changes: 1 addition & 1 deletion tests/JsonLd/ContextBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function testResourceContextWithoutHydraPrefix(): void
$contextBuilder = new ContextBuilder($this->resourceNameCollectionFactoryProphecy->reveal(), $this->resourceMetadataCollectionFactoryProphecy->reveal(), $this->propertyNameCollectionFactoryProphecy->reveal(), $this->propertyMetadataFactoryProphecy->reveal(), $this->urlGeneratorProphecy->reveal(), null, null, [ContextBuilder::HYDRA_CONTEXT_HAS_PREFIX => false]);

$expected = [
'http://www.w3.org/ns/hydra/context.jsonld',
'https://www.w3.org/ns/hydra/context.jsonld',
[
'@vocab' => '#',
'hydra' => 'http://www.w3.org/ns/hydra/core#',
Expand Down

0 comments on commit 4f1cdfb

Please sign in to comment.