Skip to content

Commit 24cdc43

Browse files
jschaedlfabpot
authored andcommitted
[Serializer] Consider SerializedPath in debug command output
1 parent 5c847bc commit 24cdc43

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Symfony/Component/Serializer/Command/DebugCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private function getAttributesData(ClassMetadataInterface $classMetadata): array
102102
'groups' => $attributeMetadata->getGroups(),
103103
'maxDepth' => $attributeMetadata->getMaxDepth(),
104104
'serializedName' => $attributeMetadata->getSerializedName(),
105+
'serializedPath' => $attributeMetadata->getSerializedPath() ? (string) $attributeMetadata->getSerializedPath() : null,
105106
'ignore' => $attributeMetadata->isIgnored(),
106107
'normalizationContexts' => $attributeMetadata->getNormalizationContexts(),
107108
'denormalizationContexts' => $attributeMetadata->getDenormalizationContexts(),

src/Symfony/Component/Serializer/Tests/Command/DebugCommandTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function testOutputWithClassArgument()
4646
| | ], |
4747
| | "maxDepth" => 1, |
4848
| | "serializedName" => "identifier", |
49+
| | "serializedPath" => null, |
4950
| | "ignore" => true, |
5051
| | "normalizationContexts" => [ |
5152
| | "*" => [ |
@@ -66,6 +67,7 @@ public function testOutputWithClassArgument()
6667
| | "groups" => [], |
6768
| | "maxDepth" => null, |
6869
| | "serializedName" => null, |
70+
| | "serializedPath" => [data][name], |
6971
| | "ignore" => false, |
7072
| | "normalizationContexts" => [], |
7173
| | "denormalizationContexts" => [] |

src/Symfony/Component/Serializer/Tests/Dummy/DummyClassOne.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Serializer\Attribute\Ignore;
1717
use Symfony\Component\Serializer\Attribute\MaxDepth;
1818
use Symfony\Component\Serializer\Attribute\SerializedName;
19+
use Symfony\Component\Serializer\Attribute\SerializedPath;
1920

2021
class DummyClassOne
2122
{
@@ -29,5 +30,6 @@ class DummyClassOne
2930
)]
3031
public string $code;
3132

33+
#[SerializedPath('[data][name]')]
3234
public string $name;
3335
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy