yml_reference.rst 2.2 KB

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