[PHP][Symfony] Further enhancements (#7001)

* Further enchancements for PHP-Symfony. Fixes issues described in #6999

* Ran shell script to update petstore sample
This commit is contained in:
naelrashdeen
2017-11-27 09:25:50 +01:00
committed by William Cheng
parent a565a94a06
commit 5d59dd10ec
19 changed files with 165 additions and 122 deletions

View File

@@ -87,7 +87,6 @@ class PetController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\Pet', $inputFormat);
// Validate the input values
@@ -162,17 +161,12 @@ class PetController extends Controller
$securitypetstore_auth = $request->headers->get('authorization');
// Read out all input parameter values into variables
$apiKey = $request->headers->get('apiKey');
$apiKey = $request->headers->get('api_key');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$petId = $this->deserialize($petId, 'int', 'string');
$apiKey = $request->headers->get('apiKey');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$apiKey = $this->deserialize($apiKey, 'string', 'string');
// Validate the input values
@@ -258,7 +252,7 @@ class PetController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$status = $this->deserialize($status, 'array<csv>', 'string');
$status = $this->deserialize($status, 'array<csv,string>', 'string');
// Validate the input values
$asserts = [];
@@ -345,7 +339,7 @@ class PetController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$tags = $this->deserialize($tags, 'array<csv>', 'string');
$tags = $this->deserialize($tags, 'array<csv,string>', 'string');
// Validate the input values
$asserts = [];
@@ -521,7 +515,6 @@ class PetController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\Pet', $inputFormat);
// Validate the input values
@@ -609,19 +602,7 @@ class PetController extends Controller
// Deserialize the input values that needs it
$petId = $this->deserialize($petId, 'int', 'string');
$name = $request->request->get('name');
$status = $request->request->get('status');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$name = $this->deserialize($name, 'string', 'string');
$name = $request->request->get('name');
$status = $request->request->get('status');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$status = $this->deserialize($status, 'string', 'string');
// Validate the input values
@@ -715,19 +696,7 @@ class PetController extends Controller
// Deserialize the input values that needs it
$petId = $this->deserialize($petId, 'int', 'string');
$additionalMetadata = $request->request->get('additionalMetadata');
$file = $request->files->get('file');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$additionalMetadata = $this->deserialize($additionalMetadata, 'string', 'string');
$additionalMetadata = $request->request->get('additionalMetadata');
$file = $request->files->get('file');
// Use the default value if no value was provided
// Deserialize the input values that needs it
// Validate the input values
$asserts = [];

View File

@@ -150,6 +150,10 @@ class StoreController extends Controller
// Read out all input parameter values into variables
// Use the default value if no value was provided
// Deserialize the input values that needs it
// Validate the input values
@@ -306,7 +310,6 @@ class StoreController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\Order', $inputFormat);
// Validate the input values

View File

@@ -83,7 +83,6 @@ class UserController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat);
// Validate the input values
@@ -166,14 +165,13 @@ class UserController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\User[]', $inputFormat);
$body = $this->deserialize($body, 'array<Swagger\Server\Model\User>', $inputFormat);
// Validate the input values
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\All([
new Assert\Type("Swagger\Server\Model\User[]")
new Assert\Type("Swagger\Server\Model\User")
]);
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
@@ -251,14 +249,13 @@ class UserController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\User[]', $inputFormat);
$body = $this->deserialize($body, 'array<Swagger\Server\Model\User>', $inputFormat);
// Validate the input values
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\All([
new Assert\Type("Swagger\Server\Model\User[]")
new Assert\Type("Swagger\Server\Model\User")
]);
$response = $this->validate($body, $asserts);
if ($response instanceof Response) {
@@ -485,12 +482,6 @@ class UserController extends Controller
// Deserialize the input values that needs it
$username = $this->deserialize($username, 'string', 'string');
$username = $request->query->get('username');
$password = $request->query->get('password');
// Use the default value if no value was provided
// Deserialize the input values that needs it
$password = $this->deserialize($password, 'string', 'string');
// Validate the input values
@@ -571,6 +562,10 @@ class UserController extends Controller
// Read out all input parameter values into variables
// Use the default value if no value was provided
// Deserialize the input values that needs it
// Validate the input values
@@ -644,14 +639,7 @@ class UserController extends Controller
// Use the default value if no value was provided
// Deserialize the input values that needs it
$body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat);
$body = $request->getContent();
// Use the default value if no value was provided
// Deserialize the input values that needs it
$username = $this->deserialize($username, 'string', 'string');
$body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat);
// Validate the input values