Skip to content

A suggestion for "additional configuration metadata" #30864

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

Closed
TAlcantara opened this issue May 4, 2022 · 3 comments
Closed

A suggestion for "additional configuration metadata" #30864

TAlcantara opened this issue May 4, 2022 · 3 comments
Labels
status: duplicate A duplicate of another issue

Comments

@TAlcantara
Copy link

TAlcantara commented May 4, 2022

For example, there is a configuration property class:

@Getter
@Setter
@ConfigurationProperties("foo")
@EnableConfigurationProperties(FooProperties.class)
public class FooProperties {
    @NestedConfigurationProperty
    private Map<String, BarProperties> bars;
    @Getter
    @Setter
    public static class BarProperties {
        private String testStr;
        private BarEnums barEnum;
    }
    public enum BarEnums {
        BAR_1,BAR2
    }
}

and there is the metadata generated by the configuration-processor

{
  "groups": [
    {
      "name": "foo",
      "type": "com.xxx.config.props.FooProperties",
      "sourceType": "com.xxx.config.props.FooProperties"
    },
    {
      "name": "foo.bars",
      "type": "java.util.Map",
      "sourceType": "com.xxx.config.props.FooProperties"
    }
  ]
}

The only thing that can be done is to let the IDE get simple configuration hints by supplementing the generic type of the complete Map. But as a configuration provider, I want users to get hints like other metadata in this similar situation, including sourceType, description, deprecate, possible value, etc. It is hoped that configuration metadata will be extended to support similar situations.

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

Thanks for the suggestion, @TAlcantara. I believe that this is a duplicate of #9945.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels May 4, 2022
@TAlcantara
Copy link
Author

Thanks for the suggestion, @TAlcantara. I believe that this is a duplicate of #9945.

thanks. I have read the issue you provided. Does it mean that there is no feature to optimize this problem so far, but it may be added in a future version update?

@wilkinsona
Copy link
Member

Yes, that's right.

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