Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-10817

MappingJackson2HttpMessageConverter and MappingJacksonHttpMessageConverter should use configured JSON prefix instead of hardcoded value.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.2.4, 4.0 M2
    • Fix Version/s: 3.2.5, 4.0 M3
    • Component/s: Web
    • Labels:
      None

      Description

      Thanks for adding the ability to configure a custom JSON prefix in MappingJackson(2)HttpMessageConverter in SPR-10627: https://jira.springsource.org/browse/SPR-10627.

      Unfortunately the custom value is not used when writing out the JSON, instead the hardcoded string "{} && " is used.

      This line (see GitHub links below) should instead read:

      jsonGenerator.writeRaw(jsonPrefix);

      Links (to v3.2.4.RELEASE code):

      MappingJackson2HttpMessageConverter: https://github.com/SpringSource/spring-framework/blob/v3.2.4.RELEASE/spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java#L202

      MappingJacksonHttpMessageConverter: https://github.com/SpringSource/spring-framework/blob/v3.2.4.RELEASE/spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java#L199

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              halvards Halvard Skogsrud
              Last updater:
              Spring Issuemaster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 25 weeks, 5 days ago