Due to the non-intuitive way spring.config.import works (imported files override current document - the opposite of what most people expect) it's very easy to make a mistake with configuration.

Any property defined in configuration file that is later overriden in imported file is clearly unintended and thus Spring should log a warning about it and suggest using multi-documents like in https://github.com/spring-projects/spring-boot/issues/28913#issuecomment-1008965141

Comment From: mwisnicki

Also docs at https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.external-config.files.importing should mention the multi-documents solution

Comment From: philwebb

The override behavior is intentional and designed to allow an import to override an existing value. I don't believe that all users share the view that a property later overridden by imported file is clearly unintended. If we add a warning, we're likely to annoy users who depend on and like the feature.

I'm afraid I'm also not keen to add more to the documentation since imports and multi-document solutions are distinct features and one isn't necessarily better than the other. Both sections are pretty close so should be easy to find.

I'm sorry that you don't find the current behavior intuitive.