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

Enhance spring boot configuration metadata #13299

Closed
oxsean opened this issue Nov 2, 2023 · 0 comments
Closed

Enhance spring boot configuration metadata #13299

oxsean opened this issue Nov 2, 2023 · 0 comments

Comments

@oxsean
Copy link
Collaborator

oxsean commented Nov 2, 2023

Why

Configuration beans of dubbo are located in the dubbo-common module, and it's not suitable to add spring boot dependencies.
However, spring configuration metadata generation relies on read javadoc from the source code and cannot use the @NestedConfigurationProperty annotation.
This leads to missing comments and a lack of nested configuration options. Therefore, we use an independent module to copy the code and generate metadata.

Principles

  1. Copy classes under org/apache/dubbo/config from dubbo-common to the generated-sources directory.
  2. Replace @Nest with @NestedConfigurationProperty.
  3. Copy the class DubboConfigurationProperties.java from autoconfigure to the generated-sources directory.
  4. Use an annotation-only option to compile and generate spring-configuration-metadata.json.
  5. During autoconfigure module compilation, will read spring-configuration-metadata.json from this module.

How to add a new configuration option

  • For standard configuration options, add javadoc to the corresponding configuration classes in dubbo-common.
  • For non-standard configuration options, there are unnecessary to add nested classes. add them directly to additional-spring-configuration-metadata.json.

Preview

spring-configuration-metadata.json

autocomplete

oxsean added a commit to oxsean/dubbo that referenced this issue Nov 2, 2023
@oxsean oxsean changed the title Enhance Spring Boot AutoConfiguration Enhance spring boot configuration metadata Nov 2, 2023
oxsean added a commit to oxsean/dubbo that referenced this issue Nov 4, 2023
@oxsean oxsean closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant