Spring-boot: Include spring.profiles in additional-spring-configuration-metadata.json

Created on 6 Mar 2019  路  6Comments  路  Source: spring-projects/spring-boot

The file https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
missing an entry for spring.profiles

So, intellij says the key spring.profiles is not correct, however according to https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-change-configuration-depending-on-the-environment it is correct and in use.

enhancement

All 6 comments

It is specific to YAML sub-document and can't be used anywhere else so it's a tough call. This also one more example of why we shouldn't be using a property matching a group name, see #12510

Can't it be just solved as in the logging.file case?

{
  "name": "logging.file",
  "type": "java.lang.String",
  "description": "Log file name (for instance, `myapp.log`). Names can be an exact location or relative to the current directory.",
  "sourceType": "org.springframework.boot.context.logging.LoggingApplicationListener",
  "deprecation": {
    "replacement": "logging.file.name"
  }
},
{
  "name": "logging.file.name",
  "type": "java.lang.String",
  "description": "Log file name (for instance, `myapp.log`). Names can be an exact location or relative to the current directory.",
  "sourceType": "org.springframework.boot.context.logging.LoggingApplicationListener"
}

This property is specific to YAML sub-documents as far as I can see so I am not keen for it to show as a valid property anywhere else. We can fix whatever needs fixing the way you've just described but that wasn't my point.

I agree with you, this is not the issue. And I agree that the issue is bigger in scope which is what you described as

This also one more example of why we shouldn't be using a property matching a group name

btw, I can send a PR

We'd like to confirm that this property is not specific to yaml multi-documents. If it is, we shouldn't provide auto-completion for it probably.

Was this page helpful?
0 / 5 - 0 ratings