use of org.springframework.boot.json.JsonParser in project spring-boot by spring-projects.
the class SpringApplicationJsonEnvironmentPostProcessor method processJson.
private void processJson(ConfigurableEnvironment environment, String json) {
try {
JsonParser parser = JsonParserFactory.getJsonParser();
Map<String, Object> map = parser.parseMap(json);
if (!map.isEmpty()) {
addJsonPropertySource(environment, new MapPropertySource("spring.application.json", flatten(map)));
}
} catch (Exception ex) {
logger.warn("Cannot parse JSON for spring.application.json: " + json, ex);
}
}
Aggregations