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

JacksonAutoConfiguration.FEATURE_DEFAULTS not reflected in property hint docs in properties editor. #12675

Closed
jezovuk opened this issue Mar 29, 2018 · 8 comments
Labels
status: duplicate A duplicate of another issue

Comments

@jezovuk
Copy link

jezovuk commented Mar 29, 2018

Since property hints/docs are generated based on property javadoc (when using @ConfigurationProperties), and spring.jackson.* properties target the JacksonProperties class, hint for serialization/deserialization features is inherited from enum members' javadoc in com.fasterxml.jackson.databind.SerializationFeature / com.fasterxml.jackson.databind.DeserializationFeature. These are, of course, not aware of default overrides in JacksonAutoConfiguration via FEATURE_DEFAULTS.

Encountered with Spring Boot 2.0.0.RELEASE.

I'm not sure what would be the good way around this, but at least some kind of mention/warning in documentation would be nice. Got me confused.

@snicoll
Copy link
Member

snicoll commented Mar 29, 2018

That's interesting, thanks. If we went down the route of providing custom metadata for this, we should implement #9945 first.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 29, 2018
@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review type: documentation A documentation update and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Mar 29, 2018
@snicoll snicoll added this to the 2.0.x milestone Apr 4, 2018
@snicoll
Copy link
Member

snicoll commented Apr 4, 2018

We've discussed this and there is unfortunately no way for us to override the Javadoc of Jackson's Enums (the IDE is reading that, not something we would have written).

Unfortunately, even if we had #9945, it would be quite confusing to add a hints that states a different default value than what's described in the Javadoc.

We'll review the ref guide to make sure those defaults are clearly documented.

@jezovuk
Copy link
Author

jezovuk commented Apr 5, 2018

I'm aware that hint comes from the javadoc. Just to be clear, I'm talking about property hints displayed in Spring Properties editor in Eclipse (when editing application.properties, with Spring IDE plug-in for Eclipse). However, if not explicitly specified, property spring.jackson.serialization.write-dates-as-timestamps will default to false (due to default specified in JacksonAutoConfiguration), while its hint states that this serialization feature defaults to true (hint is coming from Jackson's javadoc).

It seems that current hint is confusing (not the Jackson's javadoc by itself - it is correct as far as Jackson is concerned - but when used as Spring Boot property hint, since Spring Boot overrides the default). Updating the ref guide to explicitly state that hint is wrong in this case would be good enough, I guess.

@snicoll
Copy link
Member

snicoll commented Apr 5, 2018

Updating the ref guide to explicitly state that hint is wrong

What hint? Can you please share a screenshot where that hint is displayed?

@jezovuk
Copy link
Author

jezovuk commented Apr 5, 2018

spring-boot-12675

@snicoll
Copy link
Member

snicoll commented Apr 5, 2018

OK that confirms my suspicion.

while its hint states that this serialization feature defaults to true

I just wanted to make sure that something outside of the Javadoc wasn't providing that information. So we're back to my original comment. Based on your feedback @wilkinsona also raised spring-attic/spring-ide#265

@jezovuk
Copy link
Author

jezovuk commented Apr 5, 2018

Yes, making it obvious that I'm seeing Jackson javadoc would have helped (along with the note in ref guide). As it is, I had to dig a bit through Spring Boot and Jackson sources to make sure what is the actual default value being used.

This issue can be closed as far as I'm concerned.

@snicoll
Copy link
Member

snicoll commented Apr 5, 2018

Thanks for the feedback

@snicoll snicoll closed this as completed Apr 5, 2018
@snicoll snicoll removed this from the 2.0.x milestone Apr 5, 2018
@snicoll snicoll added status: duplicate A duplicate of another issue and removed type: documentation A documentation update labels Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants