You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ CHANGELOG
11
11
* Change the signature of `AttributeMetadataInterface::setSerializedName()` to `setSerializedName(?string)`
12
12
* Change the signature of `ClassMetadataInterface::setClassDiscriminatorMapping()` to `setClassDiscriminatorMapping(?ClassDiscriminatorMapping)`
13
13
* Add option YamlEncoder::YAML_INDENTATION to YamlEncoder constructor options to configure additional indentation for each level of nesting. This allows configuring indentation in the service configuration.
14
+
* Add `SerializedPath` annotation to flatten nested attributes
thrownewMappingException(sprintf('SerializedPath on "%s::%s()" cannot be added. SerializedPath can only be added on methods beginning with "get", "is", "has" or "set".', $className, $method->name));
thrownewMappingException(sprintf('Ignore on "%s::%s()" cannot be added. Ignore can only be added on methods beginning with "get", "is", "has" or "set".', $className, $method->name));
Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php
+9-1
Original file line number
Diff line number
Diff line change
@@ -84,13 +84,21 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool
84
84
}
85
85
86
86
if (isset($data['serialized_name'])) {
87
-
if (!\is_string($data['serialized_name']) || empty($data['serialized_name'])) {
87
+
if (!\is_string($data['serialized_name']) || '' === $data['serialized_name']) {
88
88
thrownewMappingException(sprintf('The "serialized_name" value must be a non-empty string in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName()));
if ('' === $data['serialized_path'] || [] === $data['serialized_path']) {
96
+
thrownewMappingException(sprintf('The "serialized_path" value must not be empty in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName()));
thrownewMappingException(sprintf('The "ignore" value must be a boolean in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName()));
0 commit comments