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

spring.jackson.serialization.indent-output doesn't work with Spring Boot 2.3.0.M2 when using Actuator #20211

Closed
izeye opened this issue Feb 18, 2020 · 6 comments
Assignees
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: regression A regression from a previous release
Milestone

Comments

@izeye
Copy link
Contributor

izeye commented Feb 18, 2020

spring.jackson.serialization.indent-output doesn't work with Spring Boot 2.3.0.M2. I confirmed that it works with Spring Boot 2.3.0.M1.

This is a sample project to reproduce it: https://github.com/izeye/spring-boot-throwaway-branches/tree/spring-boot-2.3.0.M2-jackson-indent-output

And this is a sample endpoint to check: http://localhost:8080/persons

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 18, 2020
@wilkinsona wilkinsona self-assigned this Feb 18, 2020
@wilkinsona
Copy link
Member

Thanks for the sample, Johnny. It works as expected with M2 if you remove the Actuator dependency. My guess is that the Actuator-specific ObjectMapper (#12951) is getting involved when it should not be.

@wilkinsona wilkinsona added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 18, 2020
@wilkinsona wilkinsona added this to the 2.3.0.M3 milestone Feb 18, 2020
@wilkinsona
Copy link
Member

Using curl to access http://localhost:8080/persons, ActuatorJsonHttpMessageConverter.canWrite(Type, Class, MediaType) is called with java.util.List<com.izeye.throwaway.Person>, java.util.ArrayList, null. This results in a call to org.springframework.http.converter.AbstractHttpMessageConverter.canWrite(MediaType) with null and it returns true:

if (mediaType == null || MediaType.ALL.equalsTypeAndSubtype(mediaType)) {
	return true;
}

@wilkinsona wilkinsona changed the title spring.jackson.serialization.indent-output doesn't work with Spring Boot 2.3.0.M2 spring.jackson.serialization.indent-output doesn't work with Spring Boot 2.3.0.M2 when using Actuator Feb 18, 2020
@wilkinsona
Copy link
Member

Another side-effect is that we serve a application/vnd.spring-boot.actuator.v3+json response:

$ curl http://localhost:8080/persons -i
HTTP/1.1 200 
Content-Type: application/vnd.spring-boot.actuator.v3+json
Transfer-Encoding: chunked
Date: Tue, 18 Feb 2020 09:54:53 GMT

[{"firstName":"Johnny","secondName":"Lim"}]

@bclozel bclozel self-assigned this Feb 18, 2020
@bclozel bclozel removed this from the 2.3.0.M3 milestone Feb 21, 2020
@bclozel bclozel added the status: superseded An issue that has been superseded by another label Feb 21, 2020
@bclozel
Copy link
Member

bclozel commented Feb 21, 2020

I've reopened #12951 and created #20290. I'm closing this issue as it's superseded by those.

@wilkinsona
Copy link
Member

We need something in the M3 release notes to indicate that the regression's been fixed. I think we should use this issue to do that.

@wilkinsona wilkinsona added status: noteworthy A noteworthy issue to call out in the release notes and removed status: superseded An issue that has been superseded by another labels Feb 25, 2020
@wilkinsona wilkinsona added this to the 2.3.0.M3 milestone Feb 25, 2020
@wilkinsona
Copy link
Member

Fixed by ab72cc8 which reverted the first attempt at providing an Actuator-specific ObjectMapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

4 participants