Skip to content

Commit c160a21

Browse files
committed
[Serializer] Add Debug command
1 parent c2cdd5e commit c160a21

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

serializer.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,45 @@ 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\SomeClass'
503+
504+
App\Entity\SomeClass
505+
--------------------
506+
507+
+----------------+------------------------------------------------------------+
508+
| Property | Options |
509+
+----------------+------------------------------------------------------------+
510+
| firstArgument | [ |
511+
| | "groups" => [ |
512+
| | "book:read", |
513+
| | "book:write", |
514+
| | ] |
515+
| | "maxDepth" => 1, |
516+
| | "serializedName" => "first_argument" |
517+
| | "ignore" => false |
518+
| | "normalizationContexts" => [], |
519+
| | "denormalizationContexts" => [] |
520+
| | ] |
521+
| secondArgument | [ |
522+
| | "groups" => [ |
523+
| | "book:read", |
524+
| | ] |
525+
| | "maxDepth" => null, |
526+
| | "serializedName" => null |
527+
| | "ignore" => false |
528+
| | "normalizationContexts" => [], |
529+
| | "denormalizationContexts" => [] |
530+
| | ] |
531+
+----------------+------------------------------------------------------------+
532+
494533
Going Further with the Serializer
495534
---------------------------------
496535

0 commit comments

Comments
 (0)