Quiero obtener los datos en el java de un array de clave/valor que estará en el YML
Yml:
profiles:
- type: user
url: www
- type: admin
url: http
Lo recojo como:
@Value("${profiles}")
private List<Profile> profiles;
Y la clase asociada es:
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Profile {
private String type;
private String url;
}
Pero me da error al intentar arrancar:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'api': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'profiles' in value "${profiles}"
¿ Qué falla ? Gracias.