Skip to content

Commit 54bf2e8

Browse files
chore: remove hydra prefix
1 parent d538688 commit 54bf2e8

File tree

21 files changed

+215
-215
lines changed

21 files changed

+215
-215
lines changed

api/config/packages/api_platform.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ api_platform:
3232
event_listeners_backward_compatibility_layer: false
3333
keep_legacy_inflector: false
3434
serializer:
35-
hydra_prefix: true
35+
hydra_prefix: false
3636
oauth:
3737
enabled: true
3838
clientId: '%env(OIDC_SWAGGER_CLIENT_ID)%'

api/tests/Api/Admin/BookTest.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function asNonAdminUserICannotGetACollectionOfBooks(int $expectedCode, st
5454
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
5555
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
5656
self::assertJsonContains([
57-
'@type' => 'hydra:Error',
58-
'hydra:title' => 'An error occurred',
59-
'hydra:description' => $hydraDescription,
57+
'@type' => 'Error',
58+
'title' => 'An error occurred',
59+
'description' => $hydraDescription,
6060
]);
6161
}
6262

@@ -77,9 +77,9 @@ public function asAdminUserICanGetACollectionOfBooks(FactoryCollection $factory,
7777
self::assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
7878
self::assertEquals('<https://localhost/.well-known/mercure>; rel="mercure"', $response->getHeaders()['link'][1]);
7979
self::assertJsonContains([
80-
'hydra:totalItems' => $hydraTotalItems,
80+
'totalItems' => $hydraTotalItems,
8181
]);
82-
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['hydra:member']);
82+
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['member']);
8383
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Book/collection.json'));
8484
}
8585

@@ -144,9 +144,9 @@ public function asAdminUserICanGetACollectionOfBooksOrderedByTitle(): void
144144
self::assertResponseIsSuccessful();
145145
self::assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
146146
self::assertEquals('<https://localhost/.well-known/mercure>; rel="mercure"', $response->getHeaders()['link'][1]);
147-
self::assertEquals('Ball Lightning', $response->toArray()['hydra:member'][0]['title']);
148-
self::assertEquals('Hyperion', $response->toArray()['hydra:member'][1]['title']);
149-
self::assertEquals('The Wandering Earth', $response->toArray()['hydra:member'][2]['title']);
147+
self::assertEquals('Ball Lightning', $response->toArray()['member'][0]['title']);
148+
self::assertEquals('Hyperion', $response->toArray()['member'][1]['title']);
149+
self::assertEquals('The Wandering Earth', $response->toArray()['member'][2]['title']);
150150
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Book/collection.json'));
151151
}
152152

@@ -196,9 +196,9 @@ public function asNonAdminUserICannotGetABook(int $expectedCode, string $hydraDe
196196
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
197197
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
198198
self::assertJsonContains([
199-
'@type' => 'hydra:Error',
200-
'hydra:title' => 'An error occurred',
201-
'hydra:description' => $hydraDescription,
199+
'@type' => 'Error',
200+
'title' => 'An error occurred',
201+
'description' => $hydraDescription,
202202
]);
203203
}
204204

@@ -254,9 +254,9 @@ public function asNonAdminUserICannotCreateABook(int $expectedCode, string $hydr
254254
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
255255
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
256256
self::assertJsonContains([
257-
'@type' => 'hydra:Error',
258-
'hydra:title' => 'An error occurred',
259-
'hydra:description' => $hydraDescription,
257+
'@type' => 'Error',
258+
'title' => 'An error occurred',
259+
'description' => $hydraDescription,
260260
]);
261261
}
262262

@@ -290,7 +290,7 @@ public static function getInvalidDataOnCreate(): iterable
290290
Response::HTTP_UNPROCESSABLE_ENTITY,
291291
[
292292
'@type' => 'ConstraintViolationList',
293-
'hydra:title' => 'An error occurred',
293+
'title' => 'An error occurred',
294294
'violations' => [
295295
[
296296
'propertyPath' => 'book',
@@ -316,8 +316,8 @@ public static function getInvalidData(): iterable
316316
Response::HTTP_UNPROCESSABLE_ENTITY,
317317
[
318318
'@type' => 'ConstraintViolationList',
319-
'hydra:title' => 'An error occurred',
320-
'hydra:description' => 'condition: This value should be of type ' . BookCondition::class . '.',
319+
'title' => 'An error occurred',
320+
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
321321
'violations' => [
322322
[
323323
'propertyPath' => 'condition',
@@ -334,8 +334,8 @@ public static function getInvalidData(): iterable
334334
Response::HTTP_UNPROCESSABLE_ENTITY,
335335
[
336336
'@type' => 'ConstraintViolationList',
337-
'hydra:title' => 'An error occurred',
338-
'hydra:description' => 'condition: This value should be of type ' . BookCondition::class . '.',
337+
'title' => 'An error occurred',
338+
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
339339
'violations' => [
340340
[
341341
'propertyPath' => 'condition',
@@ -352,7 +352,7 @@ public static function getInvalidData(): iterable
352352
Response::HTTP_UNPROCESSABLE_ENTITY,
353353
[
354354
'@type' => 'ConstraintViolationList',
355-
'hydra:title' => 'An error occurred',
355+
'title' => 'An error occurred',
356356
'violations' => [
357357
[
358358
'propertyPath' => 'book',
@@ -442,9 +442,9 @@ public function asNonAdminUserICannotUpdateBook(int $expectedCode, string $hydra
442442
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
443443
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
444444
self::assertJsonContains([
445-
'@type' => 'hydra:Error',
446-
'hydra:title' => 'An error occurred',
447-
'hydra:description' => $hydraDescription,
445+
'@type' => 'Error',
446+
'title' => 'An error occurred',
447+
'description' => $hydraDescription,
448448
]);
449449
}
450450

@@ -570,9 +570,9 @@ public function asNonAdminUserICannotDeleteABook(int $expectedCode, string $hydr
570570
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
571571
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
572572
self::assertJsonContains([
573-
'@type' => 'hydra:Error',
574-
'hydra:title' => 'An error occurred',
575-
'hydra:description' => $hydraDescription,
573+
'@type' => 'Error',
574+
'title' => 'An error occurred',
575+
'description' => $hydraDescription,
576576
]);
577577
}
578578

api/tests/Api/Admin/ReviewTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function asNonAdminUserICannotGetACollectionOfReviews(int $expectedCode,
5555
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
5656
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
5757
self::assertJsonContains([
58-
'@type' => 'hydra:Error',
59-
'hydra:title' => 'An error occurred',
60-
'hydra:description' => $hydraDescription,
58+
'@type' => 'Error',
59+
'title' => 'An error occurred',
60+
'description' => $hydraDescription,
6161
]);
6262
}
6363

@@ -81,9 +81,9 @@ public function asAdminUserICanGetACollectionOfReviews(FactoryCollection $factor
8181
self::assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
8282
self::assertEquals('<https://localhost/.well-known/mercure>; rel="mercure"', $response->getHeaders()['link'][1]);
8383
self::assertJsonContains([
84-
'hydra:totalItems' => $hydraTotalItems,
84+
'totalItems' => $hydraTotalItems,
8585
]);
86-
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['hydra:member']);
86+
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['member']);
8787
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/Review/collection.json'));
8888
}
8989

@@ -163,9 +163,9 @@ public function asNonAdminUserICannotGetAReview(int $expectedCode, string $hydra
163163
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
164164
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
165165
self::assertJsonContains([
166-
'@type' => 'hydra:Error',
167-
'hydra:title' => 'An error occurred',
168-
'hydra:description' => $hydraDescription,
166+
'@type' => 'Error',
167+
'title' => 'An error occurred',
168+
'description' => $hydraDescription,
169169
]);
170170
}
171171

@@ -227,9 +227,9 @@ public function asNonAdminUserICannotUpdateAReview(int $expectedCode, string $hy
227227
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
228228
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
229229
self::assertJsonContains([
230-
'@type' => 'hydra:Error',
231-
'hydra:title' => 'An error occurred',
232-
'hydra:description' => $hydraDescription,
230+
'@type' => 'Error',
231+
'title' => 'An error occurred',
232+
'description' => $hydraDescription,
233233
]);
234234
}
235235

@@ -334,9 +334,9 @@ public function asNonAdminUserICannotDeleteAReview(int $expectedCode, string $hy
334334
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
335335
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
336336
self::assertJsonContains([
337-
'@type' => 'hydra:Error',
338-
'hydra:title' => 'An error occurred',
339-
'hydra:description' => $hydraDescription,
337+
'@type' => 'Error',
338+
'title' => 'An error occurred',
339+
'description' => $hydraDescription,
340340
]);
341341
}
342342

api/tests/Api/Admin/UserTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public function asNonAdminUserICannotGetACollectionOfUsers(int $expectedCode, st
4747
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
4848
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
4949
self::assertJsonContains([
50-
'@type' => 'hydra:Error',
51-
'hydra:title' => 'An error occurred',
52-
'hydra:description' => $hydraDescription,
50+
'@type' => 'Error',
51+
'title' => 'An error occurred',
52+
'description' => $hydraDescription,
5353
]);
5454
}
5555

@@ -72,9 +72,9 @@ public function asAdminUserICanGetACollectionOfUsers(FactoryCollection $factory,
7272
self::assertResponseIsSuccessful();
7373
self::assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
7474
self::assertJsonContains([
75-
'hydra:totalItems' => $hydraTotalItems,
75+
'totalItems' => $hydraTotalItems,
7676
]);
77-
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['hydra:member']);
77+
self::assertCount(min($itemsPerPage ?? $hydraTotalItems, 30), $response->toArray()['member']);
7878
self::assertMatchesJsonSchema(file_get_contents(__DIR__ . '/schemas/User/collection.json'));
7979
}
8080

@@ -123,9 +123,9 @@ public function asNonAdminUserICannotGetAUser(int $expectedCode, string $hydraDe
123123
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
124124
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
125125
self::assertJsonContains([
126-
'@type' => 'hydra:Error',
127-
'hydra:title' => 'An error occurred',
128-
'hydra:description' => $hydraDescription,
126+
'@type' => 'Error',
127+
'title' => 'An error occurred',
128+
'description' => $hydraDescription,
129129
]);
130130
}
131131

api/tests/Api/Admin/schemas/Book/collection.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,24 @@
7878
"@type": {
7979
"readOnly": true,
8080
"type": "string",
81-
"pattern": "^hydra:Collection$"
81+
"pattern": "^Collection$"
8282
},
8383
"@id": {
8484
"readOnly": true,
8585
"type": "string",
8686
"pattern": "^/admin/books$"
8787
},
88-
"hydra:member": {
88+
"member": {
8989
"type": "array",
9090
"items": {
9191
"$ref": "#\/definitions\/Book:jsonld"
9292
}
9393
},
94-
"hydra:totalItems": {
94+
"totalItems": {
9595
"type": "integer",
9696
"minimum": 0
9797
},
98-
"hydra:view": {
98+
"view": {
9999
"type": "object",
100100
"properties": {
101101
"@id": {
@@ -105,33 +105,33 @@
105105
"@type": {
106106
"type": "string"
107107
},
108-
"hydra:first": {
108+
"first": {
109109
"type": "string",
110110
"format": "iri-reference"
111111
},
112-
"hydra:last": {
112+
"last": {
113113
"type": "string",
114114
"format": "iri-reference"
115115
},
116-
"hydra:next": {
116+
"next": {
117117
"type": "string",
118118
"format": "iri-reference"
119119
}
120120
}
121121
},
122-
"hydra:search": {
122+
"search": {
123123
"type": "object",
124124
"properties": {
125125
"@type": {
126126
"type": "string"
127127
},
128-
"hydra:template": {
128+
"template": {
129129
"type": "string"
130130
},
131-
"hydra:variableRepresentation": {
131+
"variableRepresentation": {
132132
"type": "string"
133133
},
134-
"hydra:mapping": {
134+
"mapping": {
135135
"type": "array",
136136
"items": {
137137
"type": "object",
@@ -161,9 +161,9 @@
161161
"@context",
162162
"@type",
163163
"@id",
164-
"hydra:member",
165-
"hydra:totalItems",
166-
"hydra:view",
167-
"hydra:search"
164+
"member",
165+
"totalItems",
166+
"view",
167+
"search"
168168
]
169169
}

0 commit comments

Comments
 (0)