yml_reference.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. max_depth: 2
  43. handler_callbacks:
  44. serialization:
  45. xml: serializeToXml
  46. json: serializeToJson
  47. deserialization:
  48. xml: deserializeFromXml
  49. callback_methods:
  50. pre_serialize: [foo, bar]
  51. post_serialize: [foo, bar]
  52. post_deserialize: [foo, bar]