Inspectopedia Help

Invalid YAML configuration

Reports unresolved and deprecated configuration keys and invalid values in Spring Boot application .yaml configuration files, which can lead to runtime errors.

Example:

server: port: invalid # Reports 'Cannot convert 'invalid' to java.lang.Integer'

If a deprecated configuration key has a replacement key, you can apply the 'Use replacement key' quick-fix.

Example:

logging: path: ${path} # Reports 'Deprecated configuration property 'logging.path''

After the quick-fix is applied:

logging: file: path: ${path}

If a configuration key is not defined in spring-configuration-metadata.json, you can apply the 'Define configuration key' quick-fix that creates the META-INF/spring-additional-configuration-metadata.json file and defines the necessary key.

Example:

new: key: value # Reports 'Cannot resolve configuration property 'new.key''

After the quick-fix is applied, the following is added to META-INF/spring-additional-configuration-metadata.json:

{ "properties": [ { "name": "new.key", "type": "java.lang.String", "description": "Description for new.key." } ] }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SpringBootApplicationYaml
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Spring | Spring Boot

Use the Replacement tokens option to define tokens used for value placeholders in configuration files. These tokens are specified in the form beginToken*endToken. Without the *, the token is assumed to be the same for start and end.

For example, the default is @ for both start and end token, which enables you to define placeholders, such as some.property=@another.property@.

Values inside the replacement token (@property.key@) will not be highlighted.

Inspection options

Here you can find the description of settings available for the Invalid YAML configuration inspection, and the reference of their default values.

Replacement tokens

[@]

Availability

By default bundled with

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin

Spring Boot, 241.18072

Last modified: 18 June 2024