Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63375

writeYaml encodes null with an English specific representation

    XMLWordPrintable

Details

    Description

      writeYaml encodes null values as "null". That's only legal in English according to [the YAML specification|https://yaml.org/type/null.html,] and some processors like Perl's YAML::Syck don't deal with it well. It would be most portable if the canonical representation was used: "~". Although the empty "" or shorthand "!!null" would probably also be good.

       

      I think this could be fixed by a custom Representer class that sets the nullRepresenter to use "~" instead of "null", although arguably this should be fixed in the RepresentNull class itself. I don't see any utility in using "null" over "~".

      Attachments

        Activity

          ianusesjenkins Ian Anderson added a comment - Also filed  https://bitbucket.org/asomov/snakeyaml/pull-requests/5/dump-null-in-the-canonical-form-instead-of
          ianusesjenkins Ian Anderson added a comment -

          As Andrey said in the SnakeYAML PR, null is the new canonical representation in YAML 1.2, https://yaml.org/type/null.html is for 1.1. And also YAML::Syck recommends setting ImplicitTyping first thing in its README to support the 1.2 changes like null. So maybe this should just be closed.

          ianusesjenkins Ian Anderson added a comment - As Andrey said in the SnakeYAML PR, null is the new canonical representation in YAML 1.2, https://yaml.org/type/null.html is for 1.1. And also YAML::Syck recommends setting ImplicitTyping first thing in its README to support the 1.2 changes like null . So maybe this should just be closed.

          People

            rsandell rsandell
            ianusesjenkins Ian Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: