Skip to content

Commit 7fe9b3d

Browse files
committed
feature #18211 [Serializer] Add debug:serializer command (loic425)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Serializer] Add `debug:serializer` command <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Fixes #18208 Commits ------- 2fe03a4 [Serializer] Add `debug:serializer` command
2 parents f50d4ed + 2fe03a4 commit 7fe9b3d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

serializer.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,50 @@ value:
491491
$framework->serializer()->nameConverter('serializer.name_converter.camel_case_to_snake_case');
492492
};
493493
494+
Debugging the Serializer
495+
------------------------
496+
497+
Use the ``debug:serializer`` command to dump the serializer metadata of a
498+
given class:
499+
500+
.. code-block:: terminal
501+
502+
$ php bin/console debug:serializer 'App\Entity\Book'
503+
504+
App\Entity\Book
505+
---------------
506+
507+
+----------+------------------------------------------------------------+
508+
| Property | Options |
509+
+----------+------------------------------------------------------------+
510+
| name | [ |
511+
| | "groups" => [ |
512+
| | "book:read", |
513+
| | "book:write", |
514+
| | ] |
515+
| | "maxDepth" => 1, |
516+
| | "serializedName" => "book_name" |
517+
| | "ignore" => false |
518+
| | "normalizationContexts" => [], |
519+
| | "denormalizationContexts" => [] |
520+
| | ] |
521+
| isbn | [ |
522+
| | "groups" => [ |
523+
| | "book:read", |
524+
| | ] |
525+
| | "maxDepth" => null, |
526+
| | "serializedName" => null |
527+
| | "ignore" => false |
528+
| | "normalizationContexts" => [], |
529+
| | "denormalizationContexts" => [] |
530+
| | ] |
531+
+----------+------------------------------------------------------------+
532+
533+
.. versionadded:: 6.3
534+
535+
The debug:serializer`` command was introduced in Symfony 6.3.
536+
537+
494538
Going Further with the Serializer
495539
---------------------------------
496540

0 commit comments

Comments
 (0)