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

writeYaml - not keeping quotes for numbers

XMLWordPrintable

      Since the v2.13 I've been experiencing issues when writing an yaml file with a string that only contains numbers.

      the final yaml is created with the number without any quotes, making the client that is taking that yaml as input to interpret it as integer instead of a string - this is highly problematic when the string contains zeros on the left.

      Steps to reproduce

      Create manually an yaml file with a number in quotes:

       

      applications:
      - name: test-app
        env:
           account-id: "0123456789"

      Read the yaml above with the readYaml step

       

      Write the same content/data using the writeYaml to a second yaml file:

      applications:
      - name: test-app
        env:
           account-id: 0123456789

      Expected:

      applications:
      - name: test-app
        env:
           account-id: '0123456789'

      I've been using for such use case since v2.8 and now I am stuck at v2.12.2 as v2.13.0 seems to have changed this behaviour.

      Please advise if I am missing something here or if I can send something to the step to do not convert the string into a number on the writeYaml step.

            rsandell rsandell
            gbrozzi Gustavo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: