Clone wiki

snakeyaml / YAML12

Important notes for migration to YAML 1.2


  1. Support for YAML 1.2 is provided in the SnakeYAML Engine project.

Why another project ?

  • supporting YAML 1.1 and YAML 1.2 in the same project is a challenge
  • avoid dependency nightmare (old code might stay as a transitive dependency)
  • that is the only chance to introduce backwards incompatible change
  • it is high time to migrate to Java 8
  • the public API is old and it requires refactoring
  • the API will be split into 2 pieces - low level and high level
  • low level API will be responsible for the spec
  • high level API will create complex data structures
  • some applications do not even need high level API (jackson, for instance)
  • high level API will be dependant on its context, it might be a few (JDK, Android, etc)
  • the smaller are the pieces the easier it is to evolve and improve (divide and conquer)
  • use the chance to get feedback from the community to improve the API

Backwards incompatible

  1. Directives are only for one document

YAML 1.1: If the document specifies no directives, it is parsed using the same settings as the previous document. If the document does specify any directives, all directives of previous documents, if any, are ignored. Example 7.13. Next Documents

YAML 1.2: "Note that each document is independent of the rest, allowing for heterogeneous log file entries.". In YAML 1.2, directives are associated with the document. They do not carry over to following documents.