mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-12 02:26:09 +03:00
Bugfix/remove pattern from property expression message error (#1670)
* remove pattern added from the Expression Violation message. This string confuses the API client showing a violation message instead of having a Regex. Any informatory message for the client should be placed in "description" * fix tests * fix typo
This commit is contained in:
parent
8e0713be53
commit
fe39acd6a8
@ -1,6 +1,11 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.8.0
|
||||
------
|
||||
|
||||
* remove pattern added from the Expression Violation message.
|
||||
|
||||
3.7.0 (unreleased)
|
||||
------------------
|
||||
|
||||
|
@ -69,8 +69,6 @@ class SymfonyConstraintAnnotationReader
|
||||
} elseif ($annotation instanceof Assert\Choice) {
|
||||
$values = $annotation->callback ? call_user_func(is_array($annotation->callback) ? $annotation->callback : [$reflectionProperty->class, $annotation->callback]) : $annotation->choices;
|
||||
$property->setEnum(array_values($values));
|
||||
} elseif ($annotation instanceof Assert\Expression) {
|
||||
$this->appendPattern($property, $annotation->message);
|
||||
} elseif ($annotation instanceof Assert\Range) {
|
||||
$property->setMinimum($annotation->min);
|
||||
$property->setMaximum($annotation->max);
|
||||
|
@ -45,7 +45,7 @@ class ApiPlatformDescriberTest extends AbstractDescriberTest
|
||||
$this->assertEquals($expectedApi->toArray(), $this->getSwaggerDoc()->toArray());
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->documentation = new Documentation(new ResourceNameCollection(['dummy' => 'dummy']));
|
||||
|
||||
|
@ -366,7 +366,6 @@ class FunctionalTest extends WebTestCase
|
||||
],
|
||||
'propertyExpression' => [
|
||||
'type' => 'integer',
|
||||
'pattern' => 'If this is a tech post, the category should be either php or symfony!',
|
||||
],
|
||||
'propertyRange' => [
|
||||
'type' => 'integer',
|
||||
|
Loading…
x
Reference in New Issue
Block a user