Skip to content

Commit

Permalink
Fix annotation not readed by validator
Browse files Browse the repository at this point in the history
  • Loading branch information
lopes-vincent committed Feb 13, 2023
1 parent 96247ee commit 0d079f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.1.10</version>
<version>2.1.11</version>
<authors>
<author>
<name>Vincent Lopes-Vicente</name>
Expand Down
7 changes: 3 additions & 4 deletions Model/Api/BaseApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ public function __construct(
ModelFactory $modelFactory,
RequestStack $requestStack,
TaxEngine $taxEngine,
EventDispatcherInterface $dispatcher
EventDispatcherInterface $dispatcher,
ValidatorInterface $validator
) {
if (class_exists(AnnotationRegistry::class)) {
AnnotationRegistry::registerLoader('class_exists');
}

$this->dispatcher = $dispatcher;
$this->validator = Validation::createValidatorBuilder()
->enableAnnotationMapping()
->getValidator();
$this->validator = $validator;

$this->modelFactory = $modelFactory;
$this->request = $requestStack->getCurrentRequest();
Expand Down

0 comments on commit 0d079f9

Please sign in to comment.