Skip to content

Commit

Permalink
fix(serializer): SerializableNormalizer will place discriminator pr…
Browse files Browse the repository at this point in the history
…operty at the beginning of the properties.
  • Loading branch information
LastDragon-ru committed Nov 9, 2023
1 parent b613ebd commit 470b9ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use function array_fill_keys;
use function array_map;
use function array_unshift;
use function class_exists;
use function is_array;
use function is_object;
Expand Down Expand Up @@ -123,7 +124,7 @@ static function (mixed $attribute): string {
$this->discriminators[$class] = $property;

if (!isset($this->attributes[$class][$property])) {
$attributes[] = $attributesAsString ? $property : new AttributeMetadata($property);
array_unshift($attributes, $attributesAsString ? $property : new AttributeMetadata($property));
}
}
}
Expand Down

0 comments on commit 470b9ed

Please sign in to comment.