Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Same HttpMessageConverter in HttpMessageConverters #2444

Closed
cemo opened this issue Feb 3, 2015 · 4 comments
Closed

Multiple Same HttpMessageConverter in HttpMessageConverters #2444

cemo opened this issue Feb 3, 2015 · 4 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@cemo
Copy link
Contributor

cemo commented Feb 3, 2015

When I was debugging for a culprit, I have noticed that there is multiple of StringHttpMessageConverter and MappingJackson2HttpMessageConverter at the end of org.springframework.boot.autoconfigure.web.HttpMessageConverters#HttpMessageConverters(boolean, java.util.Collection<org.springframework.http.converter.HttpMessageConverter<?>>)

this.converters = Collections.unmodifiableList(combined);

Can someone else also check please?

@snicoll
Copy link
Member

snicoll commented Feb 3, 2015

with what? A vanilla Spring Boot app (which version?) or something that you customized yourself?

@cemo
Copy link
Contributor Author

cemo commented Feb 3, 2015

I downloaded a sample from start.spring.io with Boot 1.2.1 + Actuator + Web modules.

@philwebb philwebb added this to the 1.2.2 milestone Feb 4, 2015
@wilkinsona wilkinsona self-assigned this Feb 4, 2015
@wilkinsona
Copy link
Member

The behaviour is intentional and is described in the javadoc:

Items are added just before any default converter of the same type (or at the front of the list if no default converter is found)

There's also a test that verifies the described behaviour. See gh-1293 for details of why this behaviour is necessary.

@wilkinsona wilkinsona removed this from the 1.2.2 milestone Feb 4, 2015
@wilkinsona wilkinsona added the status: invalid An issue that we don't feel is valid label Feb 4, 2015
@cemo cemo changed the title Multiple HttpMessageConverter in HttpMessageConverters Multiple Same HttpMessageConverter in HttpMessageConverters Feb 4, 2015
@cemo
Copy link
Contributor Author

cemo commented Feb 4, 2015

Actually I had searched but could not be successful. Thanks for information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants