Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
{{#isContainer}}
{{#items}}
$asserts[] = new Assert\All([
new Assert\Type("{{dataType}}")
new Assert\Type("{{dataType}}"),
{{^isPrimitiveType}}
new Assert\Valid(),
{{/isPrimitiveType}}
]);
{{/items}}
{{/isContainer}}
Expand All @@ -36,6 +39,9 @@
{{/isFile}}
{{^isFile}}
$asserts[] = new Assert\Type("{{dataType}}");
{{^isPrimitiveType}}
$asserts[] = new Assert\Valid();
{{/isPrimitiveType}}
{{/isFile}}
{{/isDateTime}}
{{/isDate}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function addPetAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet");
$asserts[] = new Assert\Valid();
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
return $response;
Expand Down Expand Up @@ -274,7 +275,7 @@ public function findPetsByStatusAction(Request $request)
new Assert\Choice([ "available", "pending", "sold" ])
]);
$asserts[] = new Assert\All([
new Assert\Type("string")
new Assert\Type("string"),
]);
$response = $this->validate($status, $asserts);
if ($response instanceof Response) {
Expand Down Expand Up @@ -362,7 +363,7 @@ public function findPetsByTagsAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\All([
new Assert\Type("string")
new Assert\Type("string"),
]);
$response = $this->validate($tags, $asserts);
if ($response instanceof Response) {
Expand Down Expand Up @@ -546,6 +547,7 @@ public function updatePetAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet");
$asserts[] = new Assert\Valid();
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
return $response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public function placeOrderAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type("OpenAPI\Server\Model\Order");
$asserts[] = new Assert\Valid();
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
return $response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function createUserAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type("OpenAPI\Server\Model\User");
$asserts[] = new Assert\Valid();
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
return $response;
Expand Down Expand Up @@ -180,7 +181,8 @@ public function createUsersWithArrayInputAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\All([
new Assert\Type("OpenAPI\Server\Model\User")
new Assert\Type("OpenAPI\Server\Model\User"),
new Assert\Valid(),
]);
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
Expand Down Expand Up @@ -268,7 +270,8 @@ public function createUsersWithListInputAction(Request $request)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\All([
new Assert\Type("OpenAPI\Server\Model\User")
new Assert\Type("OpenAPI\Server\Model\User"),
new Assert\Valid(),
]);
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
Expand Down Expand Up @@ -680,6 +683,7 @@ public function updateUserAction(Request $request, $username)
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type("OpenAPI\Server\Model\User");
$asserts[] = new Assert\Valid();
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
return $response;
Expand Down