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

Add support for descriptions of record components in configuration metadata generation #29403

Conversation

An1s9n
Copy link
Contributor

@An1s9n An1s9n commented Jan 14, 2022

Hello everyone!

While working on PR #29010 I've noticed that now there is no way to automatically generate descriptions in configuration metadata if you use @ConfigurationProperties with record class. Indeed, there are no explicit fields to put regular field-level Javadocs on. But there is an official way for records to do so: descriptions should be provided via class-level Javadoc tag @param.

I've added support for such usage, added test and mentioned it in reference documentation. I assume test is clear enough for understanding what I've done. Hope build will pass :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 14, 2022
@wilkinsona
Copy link
Member

wilkinsona commented Jan 26, 2022

Thanks for the PR, @An1s9n.

While looking at this I noticed some existing problems with detecting deprecated record components and opened #29526. We somewhat accidentally fell into using ConstructorParameterPropertyDescriptor for records because, on the surface at least, it just worked. Looking a little deeper, we're now noticing things that aren't working correctly and it has become apparent that we need to handle property descriptions (this PR) and property deprecation (#29526) differently.

I think we need to take a bit of a step back and review how we're handling records in general. My suspicion at the moment is that we'll either want separate property description classes for records and classes or we'll want to use composition a bit more so that we can plug in strategies for identifying property accessors and extract property descriptions from javadoc. I'm going to put this one on hold until we've had a chance to do that.

@wilkinsona wilkinsona added type: enhancement A general enhancement status: on-hold We can't start working on this issue yet and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 26, 2022
@wilkinsona wilkinsona added this to the 2.x milestone Jan 26, 2022
@scottfrederick scottfrederick added the status: pending-design-work Needs design work before any code can be developed label May 2, 2022
@wilkinsona wilkinsona modified the milestones: 2.x, 3.x May 4, 2022
@Peksa
Copy link

Peksa commented May 26, 2023

Hi! Has there been any updates and/or design work on this?

@wilkinsona
Copy link
Member

No, not yet I'm afraid. Updates will appear here or in a linked issue when we have them.

@tudburley

This comment was marked as duplicate.

@wilkinsona

This comment was marked as resolved.

@JWT007

This comment was marked as duplicate.

@wilkinsona

This comment was marked as resolved.

@JWT007

This comment was marked as duplicate.

@philwebb philwebb self-assigned this Apr 22, 2024
@philwebb philwebb removed status: on-hold We can't start working on this issue yet status: pending-design-work Needs design work before any code can be developed labels Apr 22, 2024
@philwebb philwebb modified the milestones: 3.x, 3.3.0 Apr 22, 2024
philwebb pushed a commit that referenced this pull request Apr 22, 2024
Update `spring-boot-configuration-processor` to support generating
configuration metadata from record parameter javadoc.

See gh-29403
philwebb added a commit that referenced this pull request Apr 22, 2024
Restructure `PropertyDescriptor` type hierarchy and polish code.

See gh-29403
@philwebb philwebb closed this in e8263c8 Apr 22, 2024
@philwebb
Copy link
Member

Thanks very much for the PR @An1s9n, and for your patience whilst we got around to merging it.

I've just merged this into main so that it will be available as part of the 3.3 release. Ordinarily we wouldn't make changes like this post RC, but I think it's worth making an exception for this one since it's relatively isolated and a lot of folks have voted on the issue.

For anyone watching this issue, please give the SNAPSHOT a try (when https://github.com/spring-projects/spring-boot/actions/runs/8788352195 has finished) and let us know if there are problems. We have a few weeks to iron out any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants