Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-47582

Issue Properties can not be read if they are PUT with new lines in them

    XMLWordPrintable

Details

    Description

      If the JSON input for issue properties is in a pretty format then accepts the property
      but fails to render it back in GET

      For example:

      PUT http://localhost:8090/jira/rest/api/2/issue/BAS-1/properties/key1

      {"content": "Test if works on JIRA Cloud", "completed" : 1}
      

      works as expected. A GET on this will return the value

      But if you have a JSON object with new lines like

      PUT http://localhost:8090/jira/rest/api/2/issue/BAS-1/properties/key1

      {
         "content": "Test if works on JIRA Cloud", 
         "completed" : 1
      }
      

      Then it will be accepted but will fail to read (but with a 200

      GET http://localhost:8090/jira/rest/api/2/issue/BAS-1/properties/key1

      200 : Malformed JSON: Bad string

      The problem is that the Jackson mapping on RawValues

      EntityPropertyBean has

      @JsonProperty
      @JsonRawValue
      private String value;

      It will try to turn the "json" string into raw object BUT it fails serialise it when "newline" whitespace if present. Spaces and tabs seem ok but not new lines.

      Not this is on the GET - the PUT works ok!

      Attachments

        Activity

          People

            Unassigned Unassigned
            bbaker ɹǝʞɐq pɐɹq
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: