yml_reference.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. YAML Reference
  2. --------------
  3. ::
  4. # MyBundle\Resources\config\serializer\ClassName.yml
  5. Fully\Qualified\ClassName:
  6. exclusion_policy: ALL
  7. xml_root_name: foobar
  8. exclude: true
  9. access_type: public_method # defaults to property
  10. accessor_order: custom
  11. custom_accessor_order: [propertyName1, propertyName2, ..., propertyNameN]
  12. discriminator:
  13. field_name: type
  14. map:
  15. some-value: ClassName
  16. properties:
  17. some-property:
  18. exclude: true
  19. expose: true
  20. access_type: public_method # defaults to property
  21. accessor: # access_type must be set to public_method
  22. getter: getSomeOtherProperty
  23. setter: setSomeOtherProperty
  24. type: string
  25. serialized_name: foo
  26. since_version: 1.0
  27. until_version: 1.1
  28. groups: [foo, bar]
  29. xml_attribute: true
  30. xml_value: true
  31. inline: true
  32. read_only: true
  33. xml_key_value_pairs: true
  34. xml_list:
  35. inline: true
  36. entry_name: foo
  37. xml_map:
  38. inline: true
  39. key_attribute_name: foo
  40. entry_name: bar
  41. xml_attribute_map: true
  42. handler_callbacks:
  43. serialization:
  44. xml: serializeToXml
  45. json: serializeToJson
  46. deserialization:
  47. xml: deserializeFromXml
  48. callback_methods:
  49. pre_serialize: [foo, bar]
  50. post_serialize: [foo, bar]
  51. post_deserialize: [foo, bar]