mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 11:56:09 +00:00
Use Symfony Validator service (#2143)
This commit is contained in:
committed by
Akihito Nakano
parent
d87a3b90da
commit
2593d78ce6
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace OpenAPI\Server\Service;
|
||||
|
||||
use Symfony\Component\Validator\Validation;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface as SymfonyValidatorInterface;
|
||||
|
||||
class SymfonyValidator implements ValidatorInterface
|
||||
{
|
||||
protected $validator;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(SymfonyValidatorInterface $validator)
|
||||
{
|
||||
$this->validator = Validation::createValidator();
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
public function validate($value, $constraints = null, $groups = null)
|
||||
|
||||
Reference in New Issue
Block a user