yml_reference.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. serialized_name: foo
  19. type: integer
  20. xml_namespaces:
  21. "": http://your.default.namespace
  22. atom: http://www.w3.org/2005/Atom
  23. properties:
  24. some-property:
  25. exclude: true
  26. expose: true
  27. access_type: public_method # defaults to property
  28. accessor: # access_type must be set to public_method
  29. getter: getSomeOtherProperty
  30. setter: setSomeOtherProperty
  31. type: string
  32. serialized_name: foo
  33. since_version: 1.0
  34. until_version: 1.1
  35. groups: [foo, bar]
  36. xml_attribute: true
  37. xml_value: true
  38. inline: true
  39. read_only: true
  40. xml_key_value_pairs: true
  41. xml_list:
  42. inline: true
  43. entry_name: foo
  44. xml_map:
  45. inline: true
  46. key_attribute_name: foo
  47. entry_name: bar
  48. xml_attribute_map: true
  49. xml_element:
  50. cdata: false
  51. namespace: http://www.w3.org/2005/Atom
  52. max_depth: 2
  53. handler_callbacks:
  54. serialization:
  55. xml: serializeToXml
  56. json: serializeToJson
  57. deserialization:
  58. xml: deserializeFromXml
  59. callback_methods:
  60. pre_serialize: [foo, bar]
  61. post_serialize: [foo, bar]
  62. post_deserialize: [foo, bar]