Skip to content

Log unknown properties when using @ConfigurationProperties #9936

@jkubrynski

Description

@jkubrynski

Enhancement

With YAML properties it's too easy to corrupt properties, by just adding whitespace. eg:

# incorrect
spring:
  cloud:
    stream:
      input:
        consumer:
          maxAttempts: 5
          group: api
          
# correct
spring:
  cloud:
    stream:
      input:
        consumer:
          maxAttempts: 5
        group: api

If would be great if regardless the ignoreUnknownFields property, Spring Boot could load a WARN that unmatched property was found. I think that will preserve many stupid mistakes people are making. I can possibly do a PR if you agree it should be implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions