Support .yaml extension for FILES format.
This commit is contained in:
@@ -36,7 +36,7 @@ public class ConsulFilesPropertySource extends ConsulPropertySource {
|
||||
}
|
||||
|
||||
public void init(GetValue value) {
|
||||
if (this.getContext().endsWith(".yml")) {
|
||||
if (this.getContext().endsWith(".yml") || this.getContext().endsWith(".yaml")) {
|
||||
parseValue(value, YAML);
|
||||
} else if (this.getContext().endsWith(".properties")) {
|
||||
parseValue(value, PROPERTIES);
|
||||
|
||||
@@ -75,6 +75,7 @@ public class ConsulPropertySourceLocator implements PropertySourceLocator {
|
||||
suffixes.add("/");
|
||||
} else {
|
||||
suffixes.add(".yml");
|
||||
suffixes.add(".yaml");
|
||||
suffixes.add(".properties");
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ConsulPropertySourceLocatorFilesTests {
|
||||
public static final String ROOT = PREFIX + UUID.randomUUID();
|
||||
public static final String APP_NAME = "testFilesFormat";
|
||||
public static final String APPLICATION_YML = "/application.yml";
|
||||
public static final String APPLICATION_DEV_YML = "/application-dev.yml";
|
||||
public static final String APPLICATION_DEV_YML = "/application-dev.yaml";
|
||||
public static final String APP_NAME_PROPS = "/"+APP_NAME+".properties";
|
||||
public static final String APP_NAME_DEV_PROPS = "/"+APP_NAME+"-dev.properties";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user