| @@ -27,8 +27,9 @@ | ||
| 27 | 27 | * from a given json schema. |
| 28 | 28 | * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5 |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | +#[\AllowDynamicProperties] | |
| 31 | 32 | class Model implements \ArrayAccess |
| 32 | 33 | { |
| 33 | 34 | /** |
| 34 | 35 | * If you need to specify a NULL JSON value, use Google\Model::NULL_VALUE |
| @@ -292,9 +293,9 @@ | ||
| 292 | 293 | { |
| 293 | 294 | $keyType = $key . "Type"; |
| 294 | 295 | |
| 295 | 296 | // ensure keyType is a valid class |
| 296 | - if (property_exists($this, $keyType) && class_exists($this->$keyType)) { | |
| 297 | + if (property_exists($this, $keyType) && $this->$keyType !== null && class_exists($this->$keyType)) { | |
| 297 | 298 | return $this->$keyType; |
| 298 | 299 | } |
| 299 | 300 | } |
| 300 | 301 | |