From f4a2eff4b70ea2fa20a4a1262783e386bfeeaa7e Mon Sep 17 00:00:00 2001 From: who Date: Tue, 14 Apr 2015 12:24:59 -0700 Subject: [PATCH] Fixing nested model deserialization - Issue #635 --- .../swagger-codegen/src/main/resources/php/APIClient.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache index b12921d776d..3620e671952 100644 --- a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache @@ -289,8 +289,8 @@ class APIClient { $class = "{{invokerPackage}}\\models\\".$class; $instance = new $class(); foreach ($instance::$swaggerTypes as $property => $type) { - if (isset($data->$property)) { - $original_property_name = $instance::$attributeMap[$property]; + $original_property_name = $instance::$attributeMap[$property]; + if (isset($original_property_name)) { $instance->$property = self::deserialize($data->$original_property_name, $type); } }