Skip to content

Jackson 2.6: message converter should use type only for collections [SPR-13318] #17903

Closed
@spring-projects-issues

Description

@spring-projects-issues

Markus Heiden opened SPR-13318 and commented

All our JSON entities implement an interface which is not annotated with Jackson annotations. Since using Jackson 2.6.0 the code snippet below of AbstractJackson2HttpMessageConverter#writeInternal(Object, Type, HttpOutputMessage) causes javaType always to be detected as the not annotated interface instead of the concrete JSON entity class. And Jackson later on complains about not finding any serializer for it.

if (jackson26Available && type != null && value != null && TypeUtils.isAssignable(type, value.getClass())) {
   javaType = getJavaType(type, null);
}

Affects: 4.2 GA

Issue Links:

1 votes, 10 watchers

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