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
Update to api platform v2.6 #12510
Update to api platform v2.6 #12510
Conversation
Tomanhez
commented
Apr 6, 2021
Q | A |
---|---|
Branch? | master |
Bug fix? | yes |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
License | MIT |
04602b3
to
d37bdd3
Compare
1622445
to
708b568
Compare
708b568
to
312ffe0
Compare
aca98d3
to
9b466a1
Compare
b66e752
to
ba50004
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if overwriting ExtractorPropertyMetadataFactory
service is still needed after upgrade?
@@ -447,7 +447,7 @@ public function iShouldNotBeAbleToConfirmOrderBecauseDoNotBelongsToShippingCateg | |||
|
|||
$response = $this->ordersClient->getLastResponse(); | |||
|
|||
Assert::same($response->getStatusCode(), 400); | |||
Assert::same($response->getStatusCode(), 422); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if 422
status code is a proper one here, wdyt @lchrusciel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
422 means that we are skipping validation and handling an exception. I would say, that it would be better to keep 400
@@ -72,8 +72,8 @@ private function isSameSubresource(array $context, array $currentContext): bool | |||
$subresources = array_keys($context['subresource_resources']); | |||
$currentSubresources = []; | |||
|
|||
foreach ($currentContext['identifiers'] as $identifierContext) { | |||
$currentSubresources[] = $identifierContext[1]; | |||
foreach ($currentContext['identifiers'] as [$class]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First time seeing this syntax, what does it do? 😨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -413,7 +413,7 @@ public function iShouldBeNotifiedThatItHasBeenSuccessfullyChanged(): void | |||
*/ | |||
public function iShouldBeNotifiedThatProvidedPasswordIsDifferentThanTheCurrentOne(): void | |||
{ | |||
Assert::same($this->customerClient->getLastResponse()->getStatusCode(), 400); | |||
Assert::same($this->customerClient->getLastResponse()->getStatusCode(), 422); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why some assertions are rewritten from expecting 400 to 422 and some other ones (like the one below in this file) are changed from expecting 400 to either 400 or 422?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pamil @lchrusciel @GSadee This code was 422 but was wrong showed in docs, this PR fixed it in api-platform 2.6: api-platform/core#4086
ba50004
to
ee39c62
Compare
594cfad
to
155dd7a
Compare
Thank you, Tomasz! 🎉 |