File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/php Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,11 +261,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
261261 */
262262 private function setIfExists(string $variableName, array $fields, $defaultValue): void
263263 {
264- if (self::isNullable($variableName ) && array_key_exists($variableName , $fields ) && is_null($fields [$variableName ])) {
265- $this -> openAPINullablesSetToNull [] = $variableName ;
264+ $apivar = $this -> attributeMap ()[$variableName ];
265+ if (self::isNullable($variableName ) && array_key_exists($apivar , $fields ) && is_null($fields [$apivar ])) {
266+ $this -> openAPINullablesSetToNull [] = $apivar ;
266267 }
267-
268- $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
268+ $this->container[$variableName] = $fields[$apivar] ?? $defaultValue;
269269 }
270270
271271 /**
You can’t perform that action at this time.
0 commit comments