forked from loafle/openapi-generator-original
[php-symfony] remove nested Valid constraint (#8994)
* Fix constraint Valid cannot be nested * Update PetController.php * Update UserController.php
This commit is contained in:
parent
f137f3331a
commit
74e5c3ccd3
@ -19,11 +19,11 @@
|
|||||||
{{#items}}
|
{{#items}}
|
||||||
$asserts[] = new Assert\All([
|
$asserts[] = new Assert\All([
|
||||||
new Assert\Type("{{dataType}}"),
|
new Assert\Type("{{dataType}}"),
|
||||||
{{^isPrimitiveType}}
|
|
||||||
new Assert\Valid(),
|
|
||||||
{{/isPrimitiveType}}
|
|
||||||
]);
|
]);
|
||||||
{{/items}}
|
{{/items}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
$asserts[] = new Assert\Valid();
|
||||||
|
{{/isPrimitiveType}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{^isContainer}}
|
{{^isContainer}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
|
@ -257,6 +257,7 @@ class PetController extends Controller
|
|||||||
$asserts[] = new Assert\All([
|
$asserts[] = new Assert\All([
|
||||||
new Assert\Type("string"),
|
new Assert\Type("string"),
|
||||||
]);
|
]);
|
||||||
|
$asserts[] = new Assert\Valid();
|
||||||
$response = $this->validate($status, $asserts);
|
$response = $this->validate($status, $asserts);
|
||||||
if ($response instanceof Response) {
|
if ($response instanceof Response) {
|
||||||
return $response;
|
return $response;
|
||||||
@ -345,6 +346,7 @@ class PetController extends Controller
|
|||||||
$asserts[] = new Assert\All([
|
$asserts[] = new Assert\All([
|
||||||
new Assert\Type("string"),
|
new Assert\Type("string"),
|
||||||
]);
|
]);
|
||||||
|
$asserts[] = new Assert\Valid();
|
||||||
$response = $this->validate($tags, $asserts);
|
$response = $this->validate($tags, $asserts);
|
||||||
if ($response instanceof Response) {
|
if ($response instanceof Response) {
|
||||||
return $response;
|
return $response;
|
||||||
|
@ -163,8 +163,8 @@ class UserController extends Controller
|
|||||||
$asserts[] = new Assert\NotNull();
|
$asserts[] = new Assert\NotNull();
|
||||||
$asserts[] = new Assert\All([
|
$asserts[] = new Assert\All([
|
||||||
new Assert\Type("OpenAPI\Server\Model\User"),
|
new Assert\Type("OpenAPI\Server\Model\User"),
|
||||||
new Assert\Valid(),
|
|
||||||
]);
|
]);
|
||||||
|
$asserts[] = new Assert\Valid();
|
||||||
$response = $this->validate($body, $asserts);
|
$response = $this->validate($body, $asserts);
|
||||||
if ($response instanceof Response) {
|
if ($response instanceof Response) {
|
||||||
return $response;
|
return $response;
|
||||||
@ -242,8 +242,8 @@ class UserController extends Controller
|
|||||||
$asserts[] = new Assert\NotNull();
|
$asserts[] = new Assert\NotNull();
|
||||||
$asserts[] = new Assert\All([
|
$asserts[] = new Assert\All([
|
||||||
new Assert\Type("OpenAPI\Server\Model\User"),
|
new Assert\Type("OpenAPI\Server\Model\User"),
|
||||||
new Assert\Valid(),
|
|
||||||
]);
|
]);
|
||||||
|
$asserts[] = new Assert\Valid();
|
||||||
$response = $this->validate($body, $asserts);
|
$response = $this->validate($body, $asserts);
|
||||||
if ($response instanceof Response) {
|
if ($response instanceof Response) {
|
||||||
return $response;
|
return $response;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user