Skip to content

Unknown property error shown in application.yml when using java records #955

Closed

Description

@philwebb

Describe the bug
Given the following classes:

@ConfigurationProperties("application.security")
public record SecurityProperties(List<UserProperties> users) {
	
}
public record UserProperties(String name, String password, List<String> roles) {

}

and the following application.yml

application:
  security:
    users:
    - name: "user"
      password: "password"
    - name: "admin"
      password: "secret"
      roles: ["admin"]

The application.yml editor will show:

Unknown property 'name' for type 'com.example.security.UserProperties'

If java classes with @ConstructorBinding is used, no problems are identified.

To Reproduce
As described above.

Sample
https://github.com/philwebb/whats-new-in-spring-boot-3-0

Activity

  1. added
    for: eclipse
    for: vscode
    and removed on Jan 16, 2023
  2. added this to the 4.17.2.RELEASE milestone on Jan 16, 2023
  3. BoykoAlex commented on Jan 17, 2023

    @BoykoAlex
    Contributor

    Should be fixed with: fa4e01d
    Note that string description for a property coming from a record field won't be available because it does not seem available in JDT yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: property-editing-supporttype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions