Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency api-platform/core to v3.2.9 #4129

Merged
merged 8 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"php": ">=8.1.0",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/core": "3.2.4",
"api-platform/core": "3.2.9",
"composer/package-versions-deprecated": "1.11.99",
"cweagans/composer-patches": "1.7.3",
"doctrine/doctrine-bundle": "2.11.1",
Expand Down
137 changes: 69 additions & 68 deletions api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
App\Serializer\Normalizer\TranslationConstraintViolationListNormalizer:
arguments:
- '@api_platform.hydra.normalizer.constraint_violation_list'
- '@api_platform.hal.normalizer.constraint_violation_list'
- '@api_platform.problem.normalizer.constraint_violation_list'

App\Serializer\SerializerContextBuilder:
decorates: 'api_platform.serializer.context_builder'
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Camp.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Camp extends BaseEntity implements BelongsToCampInterface, CopyFromPrototy
* The prototype camp that will be used as a template to create this camp.
* Only the ID will be persisted.
*/
#[ApiProperty(readable: false)]
#[ApiProperty(readable: false, example: '/camps/1a2b3c4d')]
#[Groups(['create'])]
public ?Camp $campPrototype = null;

Expand Down
5 changes: 4 additions & 1 deletion api/src/Security/OAuth/GoogleAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
$redirectUrl = $this->jwtDecoder->decode($request->cookies->get(JWTStateOAuth2Client::getCookieName($this->cookiePrefix)))['callback'] ?? '/';

$response = new RedirectResponse($redirectUrl);
$response->headers->set('set-cookie', $authSuccess->headers->all()['set-cookie']);

/** @var string[] $cookies */
$cookies = $authSuccess->headers->all('set-cookie');
$response->headers->set('set-cookie', $cookies);

return $response;
}
Expand Down
5 changes: 4 additions & 1 deletion api/src/Security/OAuth/HitobitoAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
$redirectUrl = $this->jwtDecoder->decode($request->cookies->get(JWTStateOAuth2Client::getCookieName($this->cookiePrefix)))['callback'] ?? '/';

$response = new RedirectResponse($redirectUrl);
$response->headers->set('set-cookie', $authSuccess->headers->all()['set-cookie']);

/** @var string[] $cookies */
$cookies = $authSuccess->headers->all('set-cookie');
$response->headers->set('set-cookie', $cookies);

return $response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class TranslationConstraintViolationListNormalizer implements NormalizerInterface {
public function __construct(
private readonly AbstractConstraintViolationListNormalizer $hydraNormalizer,
private readonly AbstractConstraintViolationListNormalizer $halNormalizer,
private readonly AbstractConstraintViolationListNormalizer $problemNormalizer,
private readonly TranslationInfoOfConstraintViolation $translationInfoOfConstraintViolation,
private readonly TranslateToAllLocalesService $translateToAllLocalesService
) {}
Expand All @@ -33,7 +33,7 @@ public function normalize(mixed $object, string $format = null, array $context =

/** @var ConstraintViolationList $object */
foreach ($object as $violation) {
foreach ($result as &$resultItem) {
foreach ($result['violations'] as &$resultItem) {
$code = $resultItem['code'] ?? null;
$propertyPath = $resultItem['propertyPath'];
$message = $resultItem['message'] ?? null;
Expand Down Expand Up @@ -80,6 +80,6 @@ public function getSupportedTypes(?string $format): array {
}

private function getNormalizerCollection(): ArrayCollection {
return new ArrayCollection([$this->hydraNormalizer, $this->halNormalizer]);
return new ArrayCollection([$this->hydraNormalizer, $this->problemNormalizer]);
}
}
2 changes: 1 addition & 1 deletion api/tests/Api/BaseEntity/CreateBaseEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testUpdateTimeTimeIsNotWritable() {
}

public function getExampleWritePayload($attributes = [], $except = []): array {
return $this->getExamplePayload(Camp::class, Post::class, $attributes, [], $except);
return $this->getExamplePayload(Camp::class, Post::class, $attributes, ['campPrototype'], $except);
}

public function getExampleReadPayload($attributes = [], $except = []): array {
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Camps/CreateCampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ public function testCreateResponseStructureMatchesReadResponseStructure() {
}

public function getExampleWritePayload($attributes = [], $except = []) {
return $this->getExamplePayload(Camp::class, Post::class, $attributes, [], $except);
return $this->getExamplePayload(Camp::class, Post::class, $attributes, ['campPrototype'], $except);
}

public function getExampleReadPayload($attributes = [], $except = []) {
Expand Down
Loading