There is a class annotated with @ConfigurationProperties. It contains fields that are loaded from a file. This file stores server settings, and I want to use them during validation. For example, if the login length is less than specified in the settings, then throw an exception. The problem is that the controller class sees the fields and allows them to be accessed, and the services and DTO request classes do not see, when referring to the fields, they are all null. I load the file with the settings via the @Autowired annotation.
Maybe in the classes of services and DTO there is some other way to get the config? Or why are the fields visible in the controller, but not in other classes?