spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

Large files can throw YAMLException due to node limits #844

Open mkluzacek opened 1 week ago

mkluzacek commented 1 week ago

Is your feature request related to a problem? Please describe. Same problem as mentioned in https://github.com/spring-projects/spring-boot/issues/23096. When loading large yaml config from consul it ends up wtih org.yaml.snakeyaml.error.YAMLException: Number of aliases for non-scalar nodes exceeds the specified max=50.

This was fixed for org.springframework.boot.env.OriginTrackedYamlLoader but is still problem in org.springframework.beans.factory.config.YamlPropertiesFactoryBean that is used by org.springframework.cloud.consul.config.ConsulPropertySource

Describe the solution you'd like Provide a way to override the settings in org.yaml.snakeyaml.LoaderOptions or use custom org.springframework.beans.factory.config.YamlProcessor in org.springframework.cloud.consul.config.ConsulPropertySource.