Skip to content

MappingJackson2HttpMessageConverter and MappingJacksonHttpMessageConverter should use configured JSON prefix instead of hardcoded value. [SPR-10817] #15443

@spring-projects-issues

Description

@spring-projects-issues

Halvard Skogsrud opened SPR-10817 and commented

Thanks for adding the ability to configure a custom JSON prefix in MappingJackson(2)HttpMessageConverter in #15255: 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


Affects: 3.2.4, 4.0 M2

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

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions