Skip to content

Conversation

MartkCz
Copy link
Contributor

@MartkCz MartkCz commented Mar 17, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets api-platform/api-platform#1205
License MIT

inspired by https://github.com/api-platform/core/blob/master/src/JsonSchema/SchemaFactory.php#L141

but idk if it's good idea pass 3rd and 4th argument too

@@ -61,4 +69,24 @@ public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Error && $data->getPrevious() instanceof ValidationException;
}

private function normalizeValidationException(ValidationException $exception): string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this code is too specific and should be reverted.

@alanpoulain
Copy link
Member

Thanks. Could you add a Behat test to make sure it works as expected?

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! But please add a test :)

@dunglas dunglas merged commit a880d96 into api-platform:master Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants