nullable) { if (!$property->nullable) { // if already false mark it as undefined (so it does not show up as `nullable: false`) $property->nullable = Generator::UNDEFINED; } return; } if ($type->isNullable()) { $property->nullable = true; } if (!$type->isNullable() && Generator::UNDEFINED !== $property->default) { return; } if (!$type->isNullable() && null !== $schema) { $propertyName = Util::getSchemaPropertyName($schema, $property); if (null === $propertyName) { return; } $existingRequiredFields = Generator::UNDEFINED !== $schema->required ? $schema->required : []; $existingRequiredFields[] = $propertyName; $schema->required = array_values(array_unique($existingRequiredFields)); } } }