yml_reference.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. YAML Reference
  2. --------------
  3. ::
  4. # MyBundle\Resources\config\serializer\Fully.Qualified.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. virtual_properties:
  17. getSomeProperty: {}
  18. properties:
  19. some-property:
  20. exclude: true
  21. expose: true
  22. access_type: public_method # defaults to property
  23. accessor: # access_type must be set to public_method
  24. getter: getSomeOtherProperty
  25. setter: setSomeOtherProperty
  26. type: string
  27. serialized_name: foo
  28. since_version: 1.0
  29. until_version: 1.1
  30. groups: [foo, bar]
  31. xml_attribute: true
  32. xml_value: true
  33. inline: true
  34. read_only: true
  35. xml_key_value_pairs: true
  36. xml_list:
  37. inline: true
  38. entry_name: foo
  39. xml_map:
  40. inline: true
  41. key_attribute_name: foo
  42. entry_name: bar
  43. xml_attribute_map: true
  44. xml_element:
  45. cdata: false
  46. max_depth: 2
  47. handler_callbacks:
  48. serialization:
  49. xml: serializeToXml
  50. json: serializeToJson
  51. deserialization:
  52. xml: deserializeFromXml
  53. callback_methods:
  54. pre_serialize: [foo, bar]
  55. post_serialize: [foo, bar]
  56. post_deserialize: [foo, bar]